Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: unexpected globbing warning #2455

Closed
nicojs opened this issue Sep 3, 2020 · 4 comments · Fixed by #2509
Closed

Regression: unexpected globbing warning #2455

nicojs opened this issue Sep 3, 2020 · 4 comments · Fixed by #2509
Assignees
Labels
🐛 Bug Something isn't working
Milestone

Comments

@nicojs
Copy link
Member

nicojs commented Sep 3, 2020

In Stryker 4.0.0-beta.4:

nicojs@nicoj03:~/stryker/perf/test/express$ npx stryker run --mutate lib/middleware/init.js
13:44:00 (31266) INFO ConfigReader Using stryker.conf.json
13:44:00 (31266) WARN InputFileResolver Globbing expression "{src,lib}/**/__tests__/**/*.+(cjs|mjs|js|ts|jsx|tsx|html|vue)" did not result in any files.

If you run with --mutate, then one wouldn't expect this warning.

@nicojs nicojs added the 🐛 Bug Something isn't working label Sep 3, 2020
@nicojs nicojs added this to the 4.0 milestone Sep 3, 2020
@simondel
Copy link
Member

@nicojs Can you still reproduce this? I get:

simon@SimonL03 ~/dev/stryker/perf/test/express (2352-deprecate-react-ts)$ npx stryker run --mutate lib/middleware/init.js
13:23:18 (9796) INFO ConfigReader Using stryker.conf.json
13:23:18 (9796) WARN InputFileResolver Globbing expression "lib/middleware/init.js" did not result in any files.
13:23:18 (9796) WARN InputFileResolver Globbing expression "{src,lib}/**/__tests__/**/*.js?(x)" did not result in any files.
13:23:18 (9796) WARN InputFileResolver Globbing expression "{src,lib}/**/?(*.)+(spec|test).js?(x)" did not result in any files.
13:23:18 (9796) WARN InputFileResolver Globbing expression "{src,lib}/**/*+(Spec|Test).js?(x)" did not result in any files.
13:23:18 (9796) WARN InputFileResolver No files selected. Please make sure you either
 (1) Run Stryker inside a Git repository; or
 (2) Specify the `files` property in your Stryker configuration (`--files via command line`).

@simondel
Copy link
Member

Alright, reproduction is now possible

@simondel
Copy link
Member

@nicojs It doesn't add the cli arguments to the default list:

11:03:14 (3037) DEBUG InputFileResolver Files to mutate: [
  "/home/simon/dev/stryker/perf/test/express/lib/middleware/init.js"
]

So it seems to just be the input files which do not have the support to hide the glob warnings when it could not be found.

@simondel
Copy link
Member

simondel commented Sep 28, 2020

My local setting was out of date. The deepMerge sees an array as an object so it will deep merge the settings. This causes the two arrays to merge together, thus causing the error that you're seeing.

If I add detailed logging this, I get:

the type of [
  '{src,lib}/**/!(*.+(s|S)pec|*.+(t|T)est).+(cjs|mjs|js|ts|jsx|tsx|html|vue)',
  '!{src,lib}/**/__tests__/**/*.+(cjs|mjs|js|ts|jsx|tsx|html|vue)'
] is object

deep merging the properties of [
  '{src,lib}/**/!(*.+(s|S)pec|*.+(t|T)est).+(cjs|mjs|js|ts|jsx|tsx|html|vue)',
  '!{src,lib}/**/__tests__/**/*.+(cjs|mjs|js|ts|jsx|tsx|html|vue)'
] with [ 'lib/middleware/init.js' ]

key '0' will be set to value 'lib/middleware/init.js' 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
2 participants