Skip to content

Commit

Permalink
convert test/unit/context.spec.js to unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Apr 21, 2018
1 parent 8c6cefd commit 70ec725
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/unit/context.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ describe('Context', function () {
});

it('should work', function () {
expect(this.calls).to.eql(['before', 'before two']);
expect(this.calls, 'to equal', ['before', 'before two']);
this.calls.push('test');
});

after(function () {
expect(this.calls).to.eql(['before', 'before two', 'test']);
expect(this.calls, 'to equal', ['before', 'before two', 'test']);
this.calls.push('after two');
});
});

after(function () {
expect(this.calls).to.eql(['before', 'before two', 'test', 'after two']);
expect(this.calls, 'to equal', ['before', 'before two', 'test', 'after two']);
});
});

Expand All @@ -38,7 +38,7 @@ describe('Context Siblings', function () {
});

it('should work', function () {
expect(this.hiddenFromSibling).to.eql('This should be hidden');
expect(this.hiddenFromSibling, 'to equal', 'This should be hidden');
});
});

Expand All @@ -48,46 +48,46 @@ describe('Context Siblings', function () {
});

it('should not have value set within a sibling describe', function () {
expect('This should be hidden').not.to.eql(this.hiddenFromSibling);
expect('This should be hidden', 'not to equal', this.hiddenFromSibling);
this.visibleFromTestSibling = 'Visible from test sibling';
});

it('should allow test siblings to modify shared context', function () {
expect('Visible from test sibling').to.eql(this.visibleFromTestSibling);
expect('Visible from test sibling', 'to equal', this.visibleFromTestSibling);
});

it('should have reset this.calls before describe', function () {
expect(this.calls).to.eql(['before', 'before sibling']);
expect(this.calls, 'to equal', ['before', 'before sibling']);
});
});

after(function () {
expect(this.calls).to.eql(['before', 'before sibling']);
expect(this.calls, 'to equal', ['before', 'before sibling']);
});
});

describe('methods', function () {
describe('timeout()', function () {
it('should return the timeout', function () {
expect(this.timeout()).to.equal(200);
expect(this.timeout(), 'to be', 200);
});
});

describe('slow()', function () {
it('should return the slow', function () {
expect(this.slow()).to.equal(75);
expect(this.slow(), 'to be', 75);
});
});

describe('enableTimeouts()', function () {
it('should return the enableTimeouts', function () {
expect(this.enableTimeouts()).to.equal(true);
expect(this.enableTimeouts(), 'to be', true);
});
});

describe('retries', function () {
it('should return the number of retries', function () {
expect(this.retries()).to.equal(-1);
expect(this.retries(), 'to be', -1);
});
});
});

0 comments on commit 70ec725

Please sign in to comment.