Skip to content

add option to encapsulate - #199

Merged
Eomm merged 6 commits into
fastify:masterfrom
dwickern:encapsulate
Oct 13, 2022
Merged

add option to encapsulate#199
Eomm merged 6 commits into
fastify:masterfrom
dwickern:encapsulate

Conversation

@dwickern

Copy link
Copy Markdown
Contributor

Checklist

Resolves #197

Comment thread README.md Outdated
Comment thread plugin.js Outdated
@dwickern

Copy link
Copy Markdown
Contributor Author

Will this change interact safely with fastify-autoload's default with the same name?

Comment thread test/test.js Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread test/test.js
next()
}, {
name: 'encapsulated-plugin',
encapsulate: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test that verifies what the docs say: does it run all the validations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you say the 1 test is enough? I'd rather avoid repeating the whole test suite

@Eomm Eomm Sep 24, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the cases that have not been tested have an undetermined state, so the maintainers can't help whoever opens an issue.

In this case, the maintainer should add a test case for it and add it to the repository etc.. in an endless pain loop.

So, we can discuss about the minimal test suite we need, but yes: 1 test is not enough of a HUGE feature like this.

So I think the minimal test suite for this test suite is:

  • check that the feature works as expected:
    • are decorators encapsulated?
    • is the fastify version check working?
    • are mandatory decorators checks applied?
    • is the required plugins option working?
  • verify how fastify reacts to this configuration (plugin name chaining)

dwickern and others added 2 commits September 22, 2022 08:28
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Eomm Eomm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you integrate this 00d2bdd
commit into this PR before landing?

@dwickern

Copy link
Copy Markdown
Contributor Author

Thanks @Eomm; I pushed your changes to this branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce an option to encapsulate the plugin

5 participants