Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aweary/assert-report
A barebones test reporter in ~1.5kb with zero dependencies
https://github.com/aweary/assert-report
Last synced: 11 days ago
JSON representation
A barebones test reporter in ~1.5kb with zero dependencies
- Host: GitHub
- URL: https://github.com/aweary/assert-report
- Owner: aweary
- Created: 2016-08-18T04:13:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T16:26:56.000Z (over 8 years ago)
- Last Synced: 2024-10-28T05:36:04.095Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# assert-report
> A barebones test reporter in ~1.5kb with zero dependencies
![alt tag](example.png)
## Overview
Do you have a really simple package that you want to test, but don't really need any bells or whistles? If so, this package might be helpful. assert-report provides an extremely minimal test result interface for those cases where you just want to write out a few tests in `test.js` and run `node test.js`. It's essentially a small wrapper around the native `assert` module.
If you want a test runner or super specific error messages, then this probably isn't what you're looking for.
## Install
```
$ npm install --save-dev assert-report
```## Usage
assert-report exports two familar methods, `describe` and `it`
#### `describe(testSuite: string, assertions: () => void)`
```js
describe('your test suite', () => {
// it blocks go here
})
```#### `it(testSuite: string, assertion: (assert) => void)`
```js
describe('your test suite', () => {
it('should use assert to pass or fail a test', assert => {
assert(myObject.property === expectedProperty)
})
})
```