Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philmander/q2junit
Run QUnit with JUnit style assertions
https://github.com/philmander/q2junit
Last synced: about 1 month ago
JSON representation
Run QUnit with JUnit style assertions
- Host: GitHub
- URL: https://github.com/philmander/q2junit
- Owner: philmander
- Created: 2012-05-20T20:19:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-21T21:04:29.000Z (over 12 years ago)
- Last Synced: 2023-03-11T11:17:25.982Z (almost 2 years ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#q2junit
Run QUnit with JUnit style assertions.
Q2JUnit adds a suite of assertion methods to the global scope which, under the hood, use
the core QUnit assertion methods. It does not modify QUnit in any way.##Usage
Include the q2junit javascript after including qunit:
```html
```
Use like regular Qunit assertions:
```javascript
test("A test", function() {
assertTrue(true);
});
```##Assertions
**assertEquals([message], expected, actual)**
Same as `equal`.**assertNotEquals([message], expected, actual)**
Same as `notEqual`.**assertArrayEquals([message], expected, actual)**
Same as `deepEqual`.**assertArrayNotEquals([message], expected, actual)**
Same as `notDeepEqual`.**assertSame([message], expected, actual)**
Same as `strictEqual`.**assertNotSame([message], expected, actual)**
Same as `notStrictEqual`.**assertTrue([message], actual)**
Asserts *actual* is a truthy value.**assertFalse([message], expected, actual)**
Asserts *actual* is a falsy value.**assertTypeOf([message], expected, actual)**
**assertInstanceOf([message], expected, actual)**
**assertNotInstanceOf([message], expected, actual)**
**assertNumber([message], actual)**
Asserts *actual* is typeof `number` or an instance of `Number`.**assertString([message], actual)**
Asserts *actual* is typeof `string` or an instance of `String`.**assertBoolean([message], actual)**
Asserts *actual* is typeof `boolean` or an instance of `Boolean`.**assertFunction([message], actual)**
**assertObject([message], actual)**
**assertArray([message], actual)**
**assertNull([message], actual)**
**assertNotNull([message], actual)**
**assertUndefined([message], actual)**
**assertNotUndefined([message], actual)**
**assertNaN([message], actual)**
**assertNotNaN([message], actual)**
**fail([message])**
Forces an assertion to fail.