Gathering detailed insights and metrics for @waterada/co-mocha
Gathering detailed insights and metrics for @waterada/co-mocha
Gathering detailed insights and metrics for @waterada/co-mocha
Gathering detailed insights and metrics for @waterada/co-mocha
npm install @waterada/co-mocha
Typescript
Module System
Min. Node Version
Node Version
NPM Version
63.7
Supply Chain
88.1
Quality
73
Maintenance
25
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
791
Last Day
1
Last Week
5
Last Month
15
Last Year
95
MIT License
4 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Oct 09, 2017
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
@waterada/co-mocha@1.0.1
Size
5.03 kB
NPM Version
4.0.5
Node Version
6.9.5
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
66.7%
5
Compared to previous week
Last Month
50%
15
Compared to previous month
Last Year
3.3%
95
Compared to previous year
co
用に書かれた generator 関数や promise の関数を mocha でテストしやすくしたもの。
node 6
以上co
mocha
chai
1npm install --save-dev @waterada/co-mocha
1const coMocha = require('@waterada/co-mocha'); 2 3it('generator を使える', coMocha.wrap(function * () { 4 let res103 = yield __generator(100); 5 let res104 = yield __promise(res103); 6 let res107 = yield __generator(res104); 7 let res108 = yield __promise(res107); 8 assert.equal(res108, 108); 9})); 10 11it('エラー発生するはずのコールバック(generator)が投げるエラーをキャッチしてチェックできる', coMocha.wrap(function * () { 12 let thrown = yield coMocha.catchThrown(function * () { 13 throw new Error('強制エラー'); 14 }); 15 thrown.assertThrows('強制エラー', 'エラーの内容を文字列でチェックできる'); 16 thrown.assertThrows(/強.{3}ー/, 'エラーの内容を正規表現でチェックできる'); 17 thrown.assertExistsInStack(__filename, {line: -4}, 'ファイル名と行番号(相対)がstackに存在している') 18}));
テスト を参考にしてください。
ローカルで動かす場合:
1npm test
docker で動かす場合:
1docker-compose run --rm node npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More