Merge pull request #1354 from sdougbrown/db/ospec-bin
[rewrite:ospec] Adjust ospec bin def, add to README
This commit is contained in:
commit
4b01d1dfd4
2 changed files with 40 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
Noiseless testing framework
|
Noiseless testing framework
|
||||||
|
|
||||||
Version: 1.1
|
Version: 1.1
|
||||||
License: MIT
|
License: MIT
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
@ -259,6 +259,42 @@ _o("a test", function() {
|
||||||
_o.run()
|
_o.run()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Running the test suite from the command-line
|
||||||
|
|
||||||
|
ospec will automatically evaluate all `*.js` files in any folder named `/tests`.
|
||||||
|
|
||||||
|
`o.run()` is automatically called by the cli - no need to call it in your test code.
|
||||||
|
|
||||||
|
#### Create an npm script in your package:
|
||||||
|
```
|
||||||
|
"scripts": {
|
||||||
|
...
|
||||||
|
"test": "ospec",
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
#### (Optionally) Install Globally
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm i -g ospec
|
||||||
|
$ ospec
|
||||||
|
```
|
||||||
|
|
||||||
|
#### (Optionally) Evaluate ES6+ code:
|
||||||
|
|
||||||
|
One way to accomplish this would be to include the 'babel-cli' module (`npm i babel-cli`)
|
||||||
|
|
||||||
|
(This would pre-suppose that you're already using babel in your project and thus have it configured to your liking).
|
||||||
|
|
||||||
|
```
|
||||||
|
$ babel-node ospec
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
"keywords": [ "testing" ],
|
"keywords": [ "testing" ],
|
||||||
"author": "Leo Horie <lhorie@hotmail.com>",
|
"author": "Leo Horie <lhorie@hotmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": "./bin/ospec",
|
"bin": {
|
||||||
|
"ospec": "./bin/ospec"
|
||||||
|
},
|
||||||
"repository": "lhorie/mithril.js#rewrite"
|
"repository": "lhorie/mithril.js#rewrite"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue