https://github.com/semibran/test-format
Format minimal tests
https://github.com/semibran/test-format
format tests
Last synced: about 1 year ago
JSON representation
Format minimal tests
- Host: GitHub
- URL: https://github.com/semibran/test-format
- Owner: semibran
- License: mit
- Created: 2017-06-01T21:48:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-01T22:12:17.000Z (about 9 years ago)
- Last Synced: 2025-06-09T01:48:54.976Z (about 1 year ago)
- Topics: format, tests
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# test-format
> Format minimal tests
A test is an object with the fields `name`, `expected`, and `result`:
```js
const format = require('test-format')
var test = {
name: 'NaN',
expected: true,
result: NaN === NaN
}
console.log(format(test))
// -> '✖ NaN'
```
Since formatted tests are just plain strings, logging multiple test results is a breeze.
```js
console.log(tests.map(format).join('\n'))
```
## install
```sh
npm install test-format
```
## license
[MIT](https://opensource.org/licenses/MIT) © [Brandon Semilla](https://git.io/semibran)