Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apla/jamocha
Write tests for mocha, then run in jasmine
https://github.com/apla/jamocha
Last synced: 8 days ago
JSON representation
Write tests for mocha, then run in jasmine
- Host: GitHub
- URL: https://github.com/apla/jamocha
- Owner: apla
- License: mit
- Created: 2019-04-09T21:21:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T08:54:54.000Z (over 1 year ago)
- Last Synced: 2024-11-09T11:42:11.035Z (3 months ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jamocha
Write tests for nodejs, then run in jasmine. Bonus: have mocha `spec` reporter (or `list`, `tap`, `nyan`).
## Usage
```sh
# prepare
npm install -D jasmine jamocha
mkdir test ; cp node_modules/jamocha/test/.jasmine.json test/# set test script to `jasmine --reporter=jamocha/spec --config=test/.jasmine.json`
node -r fs -e "const p = require('./package.json'); p.scripts.test = 'jasmine --reporter=jamocha/spec --config=test/.jasmine.json'; fs.writeFileSync ('./package.json', JSON.stringify (p, null, 2));"# test
npm test```
## Reasons
### Mocha have better reports
So, I've *adopted* them
### Jasmine `expect` almost as good as jest one
Use builtin `expect`, nodejs `assert` or anything else.
With reduced cost, because:
### Jasmine have much less deps than others
jasmine: **12 dependencies**
```
npm i -D jasmine
+ [email protected]
added 13 packages from 4 contributors and audited 16 packages in 2.371s
```mocha: **114 dependencies**
```
npm i -D mocha
+ [email protected]
added 115 packages from 507 contributors and audited 223 packages in 4.305s
```ava: **521 dependency**
```
npm i -D ava> [email protected] install jamocha/node_modules/fsevents
> node installnode-pre-gyp WARN Using needle for node-pre-gyp https download
[fsevents] Success: "jamocha/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote
+ [email protected]
added 522 packages from 223 contributors and audited 3399 packages in 14.44s
```jest: **556 dependencies**
```
npm i -D jest> [email protected] install jamocha/node_modules/fsevents
> node installnode-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "jamocha/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote
+ [email protected]
added 556 packages from 373 contributors and audited 849829 packages in 22.241s
```