Installations
npm install @waterada/co-mocha
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
6.x
Node Version
6.9.5
NPM Version
4.0.5
Score
64
Supply Chain
88.1
Quality
73
Maintenance
25
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
waterada
Download Statistics
Total Downloads
766
Last Day
1
Last Week
1
Last Month
15
Last Year
77
GitHub Statistics
MIT License
4 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Oct 09, 2017
Bundle Size
68.84 kB
Minified
17.44 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
766
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
0%
15
Compared to previous month
Last Year
-26.7%
77
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
CoMocha
概要
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-03-03
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