Skip to content

Commit

Permalink
Refactor tests re: code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Feb 12, 2019
1 parent 62390b1 commit 734d9da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/unit/suite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,12 @@ describe('Suite', function() {

suite.filterOnly();

expect(suite.suites.length, 'to be', 0);
expect(suite.tests.length, 'to be', 1);
expect(suite.tests[0].title, 'to be', 'c');
expect(suite, 'to satisfy', {
suites: expect.it('to be empty'),
tests: expect
.it('to have length', 1)
.and('to have an item satisfying', {title: 'c'})
});
});

it('should filter out all other tests and suites if a suite has `only`', function() {
Expand All @@ -623,9 +626,12 @@ describe('Suite', function() {

suite.filterOnly();

expect(suite.suites.length, 'to be', 1);
expect(suite.tests.length, 'to be', 0);
expect(suite.suites[0].title, 'to be', 'b');
expect(suite, 'to satisfy', {
suites: expect
.it('to have length', 1)
.and('to have an item satisfying', {title: 'b'}),
tests: expect.it('to be empty')
});
});
});
});
Expand Down

0 comments on commit 734d9da

Please sign in to comment.