LoginSignup
3
2

More than 5 years have passed since last update.

mochaの実行対象から_付きファイル・ディレクトリを除外する

Last updated at Posted at 2014-11-04

一例だが、これ:

$ mocha 'test/!(_)*.js' 'test/!(_)*/!(_)*.js' 'test/!(_)*/**/!(_)*.js'

で実行した場合、実行対象となるファイルのパターンマッチは以下の様になる。

実行される:

test/foo.js
test/sub/foo.js
test/sub/subsub/foo.js
test/sub/_subsub/foo.js  // _付きディレクトリ除外は直下だけ

実行されない:

test/_foo.js
test/sub/_foo.js
test/_sub/foo.js
test/sub/subsub/_foo.js  // _付きファイル除外はどこにあっても

補足と参考:

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2