jasmine-expect
Advanced tools
Comparing version 1.22.2 to 1.22.3
{ | ||
"name": "jasmine-expect", | ||
"version": "1.22.2", | ||
"description": "35+ additional matchers for the Jasmine BDD JavaScript test library", | ||
"version": "1.22.3", | ||
"description": "Additional matchers for the Jasmine BDD JavaScript testing library", | ||
"main": "index.js", | ||
"author": "Jamie Mason (https://github.com/JamieMason)", | ||
"author": "Jamie Mason <siunmaru@gmail.com>", | ||
"license": "MIT", | ||
"contributors": [ | ||
@@ -11,15 +12,13 @@ "Jamie Mason (https://github.com/JamieMason)", | ||
], | ||
"license": "MIT", | ||
"readmeFilename": "README.md", | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-concat": "^0.5.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"karma": "^0.12.17", | ||
"karma-chrome-launcher": "^0.1.4", | ||
"karma-coverage": "^0.2.4", | ||
"karma-firefox-launcher": "^0.1.3", | ||
"karma-jasmine": "^0.1.5", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"karma-script-launcher": "^0.1.0" | ||
"grunt": "0.4.5", | ||
"grunt-contrib-concat": "0.5.0", | ||
"grunt-contrib-watch": "0.6.1", | ||
"karma": "0.12.30", | ||
"karma-chrome-launcher": "0.1.7", | ||
"karma-coverage": "0.2.7", | ||
"karma-firefox-launcher": "0.1.4", | ||
"karma-jasmine": "0.3.3", | ||
"karma-phantomjs-launcher": "0.1.4", | ||
"karma-script-launcher": "0.1.0" | ||
}, | ||
@@ -26,0 +25,0 @@ "scripts": { |
173
README.md
# Jasmine-Matchers | ||
npm install jasmine-expect --save-dev | ||
```bash | ||
npm install jasmine-expect --save-dev | ||
``` | ||
@@ -9,15 +11,17 @@ > If you have some useful matchers of your own, please add them via [Pull Request](https://github.com/JamieMason/Jasmine-Matchers/pull/new/master). | ||
expect(fn).toThrow(e); | ||
expect(instance).toBe(instance); | ||
expect(mixed).toBeDefined(); | ||
expect(mixed).toBeFalsy(); | ||
expect(number).toBeGreaterThan(number); | ||
expect(number).toBeLessThan(number); | ||
expect(mixed).toBeNull(); | ||
expect(mixed).toBeTruthy(); | ||
expect(mixed).toBeUndefined(); | ||
expect(array).toContain(member); | ||
expect(string).toContain(substring); | ||
expect(mixed).toEqual(mixed); | ||
expect(mixed).toMatch(pattern); | ||
```javascript | ||
expect(fn).toThrow(e); | ||
expect(instance).toBe(instance); | ||
expect(mixed).toBeDefined(); | ||
expect(mixed).toBeFalsy(); | ||
expect(number).toBeGreaterThan(number); | ||
expect(number).toBeLessThan(number); | ||
expect(mixed).toBeNull(); | ||
expect(mixed).toBeTruthy(); | ||
expect(mixed).toBeUndefined(); | ||
expect(array).toContain(member); | ||
expect(string).toContain(substring); | ||
expect(mixed).toEqual(mixed); | ||
expect(mixed).toMatch(pattern); | ||
``` | ||
@@ -28,73 +32,89 @@ All [Jasmine-Matchers](https://github.com/JamieMason/Jasmine-Matchers) does is add a few more; | ||
expect(array).toBeArray(); | ||
expect(array).toBeArrayOfBooleans(); | ||
expect(array).toBeArrayOfNumbers(); | ||
expect(array).toBeArrayOfObjects(); | ||
expect(array).toBeArrayOfSize(size); | ||
expect(array).toBeArrayOfStrings(); | ||
expect(array).toBeEmptyArray(); | ||
expect(array).toBeNonEmptyArray(); | ||
```javascript | ||
expect(array).toBeArray(); | ||
expect(array).toBeArrayOfBooleans(); | ||
expect(array).toBeArrayOfNumbers(); | ||
expect(array).toBeArrayOfObjects(); | ||
expect(array).toBeArrayOfSize(size); | ||
expect(array).toBeArrayOfStrings(); | ||
expect(array).toBeEmptyArray(); | ||
expect(array).toBeNonEmptyArray(); | ||
``` | ||
## Booleans | ||
expect(boolean).toBeBoolean(); | ||
expect(boolean).toBeFalse(); | ||
expect(boolean).toBeTrue(); | ||
```javascript | ||
expect(boolean).toBeBoolean(); | ||
expect(boolean).toBeFalse(); | ||
expect(boolean).toBeTrue(); | ||
``` | ||
## Browser | ||
expect(element).toBeHtmlCommentNode(); | ||
expect(element).toBeHtmlNode(); | ||
expect(element).toBeHtmlTextNode(); | ||
expect(object).toBeDocument(); | ||
expect(object).toBeWindow(); | ||
```javascript | ||
expect(element).toBeHtmlCommentNode(); | ||
expect(element).toBeHtmlNode(); | ||
expect(element).toBeHtmlTextNode(); | ||
expect(object).toBeDocument(); | ||
expect(object).toBeWindow(); | ||
``` | ||
## Exceptions | ||
expect(fn).toThrowAnyError(); | ||
expect(fn).toThrowErrorOfType(string); | ||
```javascript | ||
expect(fn).toThrowAnyError(); | ||
expect(fn).toThrowErrorOfType(string); | ||
``` | ||
## Numbers | ||
expect(number).toBeEvenNumber(); | ||
expect(number).toBeNumber(); | ||
expect(number).toBeOddNumber(); | ||
expect(number).toBeWholeNumber(); | ||
expect(number).toBeWithinRange(floor, ceiling); | ||
expect(numberOrString).toBeCalculable(); | ||
```javascript | ||
expect(number).toBeEvenNumber(); | ||
expect(number).toBeNumber(); | ||
expect(number).toBeOddNumber(); | ||
expect(number).toBeWholeNumber(); | ||
expect(number).toBeWithinRange(floor, ceiling); | ||
expect(numberOrString).toBeCalculable(); | ||
``` | ||
## Objects | ||
expect(object).toBeFunction(); | ||
expect(object).toBeObject(); | ||
expect(object).toHaveArray(memberName); | ||
expect(object).toHaveArrayOfBooleans(memberName); | ||
expect(object).toHaveArrayOfNumbers(memberName); | ||
expect(object).toHaveArrayOfObjects(memberName); | ||
expect(object).toHaveArrayOfSize(memberName, size); | ||
expect(object).toHaveArrayOfStrings(memberName); | ||
expect(object).toHaveEmptyArray(memberName); | ||
expect(object).toHaveNonEmptyArray(memberName); | ||
expect(object).toImplement(api); | ||
```javascript | ||
expect(object).toBeFunction(); | ||
expect(object).toBeObject(); | ||
expect(object).toHaveArray(memberName); | ||
expect(object).toHaveArrayOfBooleans(memberName); | ||
expect(object).toHaveArrayOfNumbers(memberName); | ||
expect(object).toHaveArrayOfObjects(memberName); | ||
expect(object).toHaveArrayOfSize(memberName, size); | ||
expect(object).toHaveArrayOfStrings(memberName); | ||
expect(object).toHaveEmptyArray(memberName); | ||
expect(object).toHaveNonEmptyArray(memberName); | ||
expect(object).toImplement(api); | ||
``` | ||
## Strings | ||
expect(string).toBeEmptyString(); | ||
expect(string).toBeHtmlString(); | ||
expect(string).toBeJsonString(); | ||
expect(string).toBeLongerThan(other); | ||
expect(string).toBeNonEmptyString(); | ||
expect(string).toBeSameLengthAs(other); | ||
expect(string).toBeShorterThan(other); | ||
expect(string).toBeString(); | ||
expect(string).toBeWhitespace(); | ||
expect(string).toEndWith(expected); | ||
expect(string).toStartWith(expected); | ||
```javascript | ||
expect(string).toBeEmptyString(); | ||
expect(string).toBeHtmlString(); | ||
expect(string).toBeJsonString(); | ||
expect(string).toBeLongerThan(other); | ||
expect(string).toBeNonEmptyString(); | ||
expect(string).toBeSameLengthAs(other); | ||
expect(string).toBeShorterThan(other); | ||
expect(string).toBeString(); | ||
expect(string).toBeWhitespace(); | ||
expect(string).toEndWith(expected); | ||
expect(string).toStartWith(expected); | ||
``` | ||
## Dates | ||
expect(date).toBeAfter(date); | ||
expect(date).toBeBefore(date); | ||
expect(date).toBeDate(); | ||
expect(string).toBeIso8601(); | ||
```javascript | ||
expect(date).toBeAfter(date); | ||
expect(date).toBeBefore(date); | ||
expect(date).toBeDate(); | ||
expect(string).toBeIso8601(); | ||
``` | ||
@@ -104,26 +124,1 @@ ## Usage | ||
Just include a reference to dist/jasmine-matchers.js after your reference to Jasmine, or use `require('jasmine-expect')`. | ||
## License | ||
> Copyright © 2013 Jamie Mason, @GotNoSugarBaby, | ||
> https://github.com/JamieMason | ||
> Permission is hereby granted, free of charge, to any person | ||
> obtaining a copy of this software and associated documentation files | ||
> (the "Software"), to deal in the Software without restriction, | ||
> including without limitation the rights to use, copy, modify, merge, | ||
> publish, distribute, sublicense, and/or sell copies of the Software, | ||
> and to permit persons to whom the Software is furnished to do so, | ||
> subject to the following conditions: | ||
> The above copyright notice and this permission notice shall be | ||
> included in all copies or substantial portions of the Software. | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
> BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
> ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
> SOFTWARE. |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
61847
122