Skip to content

Commit bfa9bdd

Browse files
author
DavertMik
committed
updated tests
1 parent 304244b commit bfa9bdd

18 files changed

+1231
-1135
lines changed

test/unit/assert/empty_test.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
let expect;
1+
let expect
22
import('chai').then(chai => {
3-
expect = chai.expect;
4-
});
3+
expect = chai.expect
4+
})
55

6-
const { Assertion } = require('../../../lib/assert/empty');
7-
const AssertionError = require('../../../lib/assert/error');
6+
const { Assertion } = require('../../../lib/assert/empty')
7+
const AssertionError = require('../../../lib/assert/error')
88

9-
let empty;
9+
let empty
1010

1111
describe('empty assertion', () => {
1212
beforeEach(() => {
13-
empty = new Assertion({ subject: 'web page' });
14-
});
13+
empty = new Assertion({ subject: 'web page' })
14+
})
1515

1616
it('should check for something to be empty', () => {
17-
empty.assert(null);
18-
expect(() => empty.negate(null)).to.throw(AssertionError);
19-
});
17+
empty.assert(null)
18+
expect(() => empty.negate(null)).to.throw(AssertionError)
19+
})
2020

2121
it('should check for something not to be empty', () => {
22-
empty.negate('something');
23-
expect(() => empty.assert('something')).to.throw(AssertionError);
24-
});
22+
empty.negate('something')
23+
expect(() => empty.assert('something')).to.throw(AssertionError)
24+
})
2525

2626
it('should provide nice assert error message', () => {
27-
empty.params.value = '/nothing';
28-
const err = empty.getFailedAssertion();
29-
expect(err.inspect()).to.equal("expected web page '/nothing' to be empty");
30-
});
27+
empty.params.value = '/nothing'
28+
const err = empty.getFailedAssertion()
29+
expect(err.inspect()).to.equal("expected web page '/nothing' to be empty")
30+
})
3131

3232
it('should provide nice negate error message', () => {
33-
empty.params.value = '/nothing';
34-
const err = empty.getFailedNegation();
35-
expect(err.inspect()).to.equal("expected web page '/nothing' not to be empty");
36-
});
37-
});
33+
empty.params.value = '/nothing'
34+
const err = empty.getFailedNegation()
35+
expect(err.inspect()).to.equal("expected web page '/nothing' not to be empty")
36+
})
37+
})

test/unit/assert/equal_test.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
let expect;
1+
let expect
22
import('chai').then(chai => {
3-
expect = chai.expect;
4-
});
3+
expect = chai.expect
4+
})
55

6-
const { Assertion } = require('../../../lib/assert/equal');
7-
const AssertionError = require('../../../lib/assert/error');
6+
const { Assertion } = require('../../../lib/assert/equal')
7+
const AssertionError = require('../../../lib/assert/error')
88

9-
let equal;
9+
let equal
1010

1111
describe('equal assertion', () => {
1212
beforeEach(() => {
13-
equal = new Assertion({ jar: 'contents of webpage' });
14-
});
13+
equal = new Assertion({ jar: 'contents of webpage' })
14+
})
1515

1616
it('should check for equality', () => {
17-
equal.assert('hello', 'hello');
18-
expect(() => equal.negate('hello', 'hello')).to.throw(AssertionError);
19-
});
17+
equal.assert('hello', 'hello')
18+
expect(() => equal.negate('hello', 'hello')).to.throw(AssertionError)
19+
})
2020

2121
it('should check for something not to be equal', () => {
22-
equal.negate('hello', 'hi');
23-
expect(() => equal.assert('hello', 'hi')).to.throw(AssertionError);
24-
});
22+
equal.negate('hello', 'hi')
23+
expect(() => equal.assert('hello', 'hi')).to.throw(AssertionError)
24+
})
2525

2626
it('should provide nice assert error message', () => {
27-
equal.params.expected = 'hello';
28-
equal.params.actual = 'hi';
29-
const err = equal.getFailedAssertion();
30-
expect(err.inspect()).to.equal('expected contents of webpage "hello" to equal "hi"');
31-
});
27+
equal.params.expected = 'hello'
28+
equal.params.actual = 'hi'
29+
const err = equal.getFailedAssertion()
30+
expect(err.inspect()).to.equal('expected contents of webpage "hello" to equal "hi"')
31+
})
3232

3333
it('should provide nice negate error message', () => {
34-
equal.params.expected = 'hello';
35-
equal.params.actual = 'hello';
36-
const err = equal.getFailedNegation();
37-
expect(err.inspect()).to.equal('expected contents of webpage "hello" not to equal "hello"');
38-
});
39-
});
34+
equal.params.expected = 'hello'
35+
equal.params.actual = 'hello'
36+
const err = equal.getFailedNegation()
37+
expect(err.inspect()).to.equal('expected contents of webpage "hello" not to equal "hello"')
38+
})
39+
})

test/unit/assert/include_test.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
let expect;
1+
let expect
22
import('chai').then(chai => {
3-
expect = chai.expect;
4-
});
3+
expect = chai.expect
4+
})
55

6-
const Assertion = require('../../../lib/assert/include').Assertion;
7-
const AssertionError = require('../../../lib/assert/error');
6+
const Assertion = require('../../../lib/assert/include').Assertion
7+
const AssertionError = require('../../../lib/assert/error')
88

9-
let equal;
9+
let equal
1010

1111
describe('equal assertion', () => {
1212
beforeEach(() => {
13-
equal = new Assertion({ jar: 'contents of webpage' });
14-
});
13+
equal = new Assertion({ jar: 'contents of webpage' })
14+
})
1515

1616
it('should check for inclusion', () => {
17-
equal.assert('h', 'hello');
18-
expect(() => equal.negate('h', 'hello')).to.throw(AssertionError);
19-
});
17+
equal.assert('h', 'hello')
18+
expect(() => equal.negate('h', 'hello')).to.throw(AssertionError)
19+
})
2020

2121
it('should check !include', () => {
22-
equal.negate('x', 'hello');
23-
expect(() => equal.assert('x', 'hello')).to.throw(AssertionError);
24-
});
22+
equal.negate('x', 'hello')
23+
expect(() => equal.assert('x', 'hello')).to.throw(AssertionError)
24+
})
2525

2626
it('should provide nice assert error message', () => {
27-
equal.params.needle = 'hello';
28-
equal.params.haystack = 'x';
29-
const err = equal.getFailedAssertion();
30-
expect(err.inspect()).to.equal('expected contents of webpage to include "hello"');
31-
});
27+
equal.params.needle = 'hello'
28+
equal.params.haystack = 'x'
29+
const err = equal.getFailedAssertion()
30+
expect(err.inspect()).to.equal('expected contents of webpage to include "hello"')
31+
})
3232

3333
it('should provide nice negate error message', () => {
34-
equal.params.needle = 'hello';
35-
equal.params.haystack = 'h';
36-
const err = equal.getFailedNegation();
37-
expect(err.inspect()).to.equal('expected contents of webpage not to include "hello"');
38-
});
39-
});
34+
equal.params.needle = 'hello'
35+
equal.params.haystack = 'h'
36+
const err = equal.getFailedNegation()
37+
expect(err.inspect()).to.equal('expected contents of webpage not to include "hello"')
38+
})
39+
})

0 commit comments

Comments
 (0)