Skip to content

Commit

Permalink
fix(npm): update dependencies
Browse files Browse the repository at this point in the history
add-matchers@0.6.2 fixes a regression affecting tests which include an
optional message. Tests have been added to prevent future regressions.

Closes #103
  • Loading branch information
JamieMason committed Jan 12, 2019
1 parent 9f492d8 commit 4f858fd
Show file tree
Hide file tree
Showing 3 changed files with 306 additions and 177 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"ik9999 (https://github.com/ik9999)"
],
"dependencies": {
"add-matchers": "0.6.0"
"add-matchers": "0.6.2"
},
"devDependencies": {
"@types/jest": "23.3.10",
"@types/jest": "23.3.12",
"@types/node": "10.12.18",
"codeclimate-test-reporter": "0.5.1",
"globby": "8.0.1",
"globby": "9.0.0",
"jasmine-core": "3.3.0",
"jest": "23.6.0",
"karma": "3.1.4",
"karma-browserstack-launcher": "1.3.0",
"karma-browserstack-launcher": "1.4.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "2.0.0",
"karma-coverage": "1.1.2",
Expand All @@ -44,14 +44,14 @@
"karma-nested-reporter": "0.1.6",
"npm-run-all": "4.1.5",
"prettier": "1.15.3",
"rimraf": "2.6.2",
"rimraf": "2.6.3",
"saucelabs": "1.5.0",
"ts-jest": "23.10.5",
"ts-loader": "5.3.2",
"tslint": "5.12.0",
"ts-loader": "5.3.3",
"tslint": "5.12.1",
"typescript": "3.2.2",
"webpack": "4.28.2",
"webpack-cli": "3.1.2"
"webpack": "4.28.4",
"webpack-cli": "3.2.1"
},
"homepage": "https://github.com/JamieMason/Jasmine-Matchers",
"keywords": [
Expand Down
43 changes: 43 additions & 0 deletions test/optionalMessages.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
it('should handle optional messages', () => {
const MSG = 'some optional message';
let _undefined;
expect(new Date('2013-01-01T01:00:00.000Z')).toBeAfter(
new Date('2013-01-01T00:00:00.000Z'),
MSG
);
expect([]).toBeArray(MSG);
expect([]).toBeArrayOfSize(0, MSG);
expect(new Date('2013-01-01T00:00:00.000Z')).toBeBefore(
new Date('2013-01-01T01:00:00.000Z'),
MSG
);
expect(true).toBeBoolean(MSG);
expect('1').toBeCalculable(MSG);
expect(new Date()).toBeDate(MSG);
expect([]).toBeEmptyArray(MSG);
expect({}).toBeEmptyObject(MSG);
expect('').toBeEmptyString(MSG);
expect(2).toBeEvenNumber(MSG);
expect(false).toBeFalse(MSG);
expect(() => {}).toBeFunction(MSG);
expect('<element>text</element>').toBeHtmlString(MSG);
expect('2013-07-08T07:29:15.863Z').toBeIso8601(MSG);
expect('{}').toBeJsonString(MSG);
expect('abc').toBeLongerThan('ab', MSG);
expect(4.23223432434).toBeNear(4, 0.25, MSG);
expect([null]).toBeNonEmptyArray(MSG);
expect({ a: 1 }).toBeNonEmptyObject(MSG);
expect(' ').toBeNonEmptyString(MSG);
expect(1).toBeNumber(MSG);
expect(new Object()).toBeObject(MSG);
expect(1).toBeOddNumber(MSG);
expect(new RegExp()).toBeRegExp(MSG);
expect('ab').toBeSameLengthAs('ab', MSG);
expect('ab').toBeShorterThan('abc', MSG);
expect('').toBeString(MSG);
expect(true).toBeTrue(MSG);
expect(new Date()).toBeValidDate(MSG);
expect(' ').toBeWhitespace(MSG);
expect(1).toBeWholeNumber(MSG);
expect(0).toBeWithinRange(0, 2, MSG);
});
Loading

0 comments on commit 4f858fd

Please sign in to comment.