Skip to content

Commit

Permalink
🐛 Fix nested siblings are not ignored using it.only
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Sep 18, 2018
1 parent a827884 commit 66fcb2e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/describe.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export default class Describe {
}
itOnly(title, fn, options = {}) {
this.setOptionsRoot({ only: true });
this.setOptions({ onlyIgnore: false });
this.it(title, fn, Object.assign({}, options, { onlyIgnore: true }));
}
describe(title, fn, options = {}) {
Expand Down
2 changes: 1 addition & 1 deletion test/evaluate/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ process.on("unhandledRejection", function(error) {
const glob = process.argv.slice(2)[0];
const url = new URL(glob, new URL(`file://${process.cwd()}/`));
const { expects = [], fails = [] } = await import(url);
deepEqual(expects, await root.evaluate(mockReporter));
deepEqual(expects, await root.evaluate(mockReporter), url);
deepEqual(fails, mockReporter.failures, url);
})();
6 changes: 6 additions & 0 deletions test/evaluate/describe/only-only.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe.only("foo", (it, describe) => {
it("foo", () => 1);
it.only("bar", () => 2);
});

export const expects = [2];

0 comments on commit 66fcb2e

Please sign in to comment.