Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nullvoxpopuli/qunit-assertions-extra
Collection of helpful assertions for use with qunit
https://github.com/nullvoxpopuli/qunit-assertions-extra
ember hacktoberfest qunit
Last synced: 13 days ago
JSON representation
Collection of helpful assertions for use with qunit
- Host: GitHub
- URL: https://github.com/nullvoxpopuli/qunit-assertions-extra
- Owner: NullVoxPopuli
- License: mit
- Created: 2019-10-28T23:42:43.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T17:14:05.000Z (5 months ago)
- Last Synced: 2025-01-12T15:05:43.039Z (13 days ago)
- Topics: ember, hacktoberfest, qunit
- Language: TypeScript
- Homepage:
- Size: 712 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
qunit-assertions-extra
==============================================================================A Collection of helpful assertions for use with qunit.
```ts
assert.contains('Hello there!', 'Hello');
assert.contains([1, 3], 3);assert.matches('Hello there!', /Hello/);
```Installation
------------------------------------------------------------------------------```
yarn add --dev qunit-assertions-extra
npm install --save-dev qunit-assertions-extra
```Then, wherever qunit tests are initialized, add
```ts
import * as QUnit from 'qunit';
import { setup } from 'qunit-assertions-extra';setup(QUnit.assert);
```This will also enable the tsserver to provide intellisense for `assert`.
## Ember Projects
Requirements: [ember-auto-import](https://github.com/ef4/ember-auto-import) and add the above import to your `tests/test-helper.js` file.
Example:
```js
import Application from '../app';
import * as QUnit from 'qunit';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import { setup } from 'qunit-assertions-extra';setup(QUnit.assert);
setApplication(Application.create(config.APP));
start();
```Contributing
------------------------------------------------------------------------------See the [Contributing](CONTRIBUTING.md) guide for details.
Prior Art
------------------------------------------------------------------------------
- [qunit-dom](https://github.com/simplabs/qunit-dom)
much of the config for this repo was taken from qunit-dom.License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).