@jcoreio/toolchain-mocha 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.mocharc.cjs CHANGED
@@ -1,17 +1,12 @@
1
1
  const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync.cjs')
2
2
  const extensions = getPluginsArraySync('sourceExtensions')
3
- const path = require('path')
4
-
5
- const files = process.argv.slice(2).filter((f) => {
6
- const ext = path.extname(f)
7
- return ext && extensions.includes(ext.substring(1))
8
- })
3
+ const cliSpecs = require('./cliSpecs.cjs')
9
4
 
10
5
  module.exports = {
11
6
  require: [require.resolve('./util/configureMocha.cjs')],
12
7
  reporter: 'spec',
13
8
  spec: [
14
9
  require.resolve('./util/mochaWatchClearConsole.cjs'),
15
- ...(files.length ? files : getPluginsArraySync('mochaSpecs')),
10
+ ...(cliSpecs.length ? cliSpecs : getPluginsArraySync('mochaSpecs')),
16
11
  ],
17
12
  }
package/cliSpecs.cjs ADDED
@@ -0,0 +1,42 @@
1
+ const valuedOptions = new Set([
2
+ '--global',
3
+ '--globals',
4
+ '-j',
5
+ '--jobs',
6
+ '--retries',
7
+ '-s',
8
+ '--slow',
9
+ '-t',
10
+ '--timeout',
11
+ '--timeouts',
12
+ '-u',
13
+ '--ui',
14
+ '-R',
15
+ '--reporter',
16
+ '-O',
17
+ '--reporter-option',
18
+ '--reporter-options',
19
+ '--config',
20
+ '-n',
21
+ '--no-options',
22
+ '--package',
23
+ '--extension',
24
+ '--file',
25
+ '--ignore',
26
+ '--exclude',
27
+ '-r',
28
+ '--require',
29
+ '--watch-files',
30
+ '--watch-ignore',
31
+ '-f',
32
+ '--fgrep',
33
+ '-g',
34
+ '--grep',
35
+ ])
36
+
37
+ module.exports = process.argv
38
+ .slice(2)
39
+ .filter(
40
+ (f, index, argv) =>
41
+ !f.startsWith('-') && !valuedOptions.has(argv[index - 1])
42
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain-mocha",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Mocha build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,10 +22,10 @@
22
22
  "mocha": "^10.2.0",
23
23
  "nyc": "^15.1.0",
24
24
  "resolve-bin": "^1.0.0",
25
- "@jcoreio/toolchain": "3.4.0"
25
+ "@jcoreio/toolchain": "3.5.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "@jcoreio/toolchain": "3.4.0"
28
+ "@jcoreio/toolchain": "3.5.0"
29
29
  },
30
30
  "toolchainManaged": {
31
31
  "devDependencies": {
@@ -3,6 +3,6 @@ const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync
3
3
  module.exports = [
4
4
  () => [
5
5
  `test/**/*.{${getPluginsArraySync('sourceExtensions').join(',')}}`,
6
- `**/__tests__/*.{${getPluginsArraySync('sourceExtensions').join(',')}}`,
6
+ `src/**/__tests__/*.{${getPluginsArraySync('sourceExtensions').join(',')}}`,
7
7
  ],
8
8
  ]