Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] multiple before() or after() empty blocks can be added to a test suite #202

Closed
ngarbezza opened this issue Sep 25, 2021 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ngarbezza
Copy link
Owner

ngarbezza commented Sep 25, 2021

Describe the bug
before() and after() are designed so that there can be only one before and after in a test suite, and it needs to have a function as an argument. Passing no parameters should be considered invalid, as well as having more than one declaration.

Version(s) affected
v5.1.0

To Reproduce

Run a test suite with the following content:

const { suite, before } = require('@pmoo/testy');

suite('wrong!', () => {
  before();
  before();
});

Expected behavior
Raise an error because of two reasons:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant