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

Done and empty suite #1092

Closed
vonagam opened this issue Oct 2, 2023 · 3 comments
Closed

Done and empty suite #1092

vonagam opened this issue Oct 2, 2023 · 3 comments

Comments

@vonagam
Copy link
Contributor

vonagam commented Oct 2, 2023

If we have this:

const vest = require("vest")

const suite = vest.create(() => {
  vest.test("foo", () => {});
});

const result = suite();

result.done(() => {
  console.log("done");
});

We will see "done" being printed.

Now, if we add vest.optional({foo: true}) before vest.test or remove vest.test altogether then the suite will run but there will be no done call.

In my use case it was something like vest.optional({name: data.name === current.name}) to avoid running tests on a name field unless it was changed.

@ealush
Copy link
Owner

ealush commented Oct 2, 2023

I think you are right. Unless targeting specifically a nonexistent fieldname (eg: .done('bla', () => {...})), done should always run at the end of the suite, even if it turned out to be empty, or without any tests actually running. Let me sort it out one moment.

@ealush
Copy link
Owner

ealush commented Oct 2, 2023

There you go. vest@5.1.1 should have it fixed.
e889bd7

@vonagam
Copy link
Contributor Author

vonagam commented Oct 2, 2023

Thanks!

@vonagam vonagam closed this as completed Oct 2, 2023
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

No branches or pull requests

2 participants