Closed1
Jest CLIのメモ
# このように`--`をつけると`package.json`のscriptsに引数を与えることができる。
$npm run test -- securityRule
# こちらと同義
$jest securityRule
package.json
{
"test": "jest",
}
また、package.json
に任意のコマンド引数を渡したい場合は${npm_config_xxx}
を使うと実現できる。
package.json
{
"test-rule": "jest securityRule/${npm_config_filename}.test.ts",
}
// 下記で実行できる
$npm run test-rule -filename='user'
このスクラップは2021/11/12にクローズされました