Starter Type: React
Starter Template: All I think?
Description:
When I try to execute the test script on Windows it fails. The strange thing is that it fails if I did yarn test or npm test but if I copied the exact command in the terminal it works fine! yarn test even works on WSL which is Windows subsystem for Linux!
Here's the error:
PS D:\Code\xxxx\mobile> yarn test
yarn run v1.22.19
$ react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'
'ionicons)' is not recognized as an internal or external command,
operable program or batch file.
[ERROR] Unable to find command: /core
[ERROR] Unable to find command: /react-router
node:events:505
throw er; // Unhandled 'error' event
^
Error: EPIPE: broken pipe, write
at Socket._write (node:internal/net:55:25)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at Socket.Writable.write (node:internal/streams/writable:334:10)
at StreamHandler.handle (C:\Users\m4des\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\@ionic\cli-framework-output\dist\logger.js:52:21)
at Logger.log (C:\Users\m4des\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\@ionic\cli-framework-output\dist\logger.js:146:21)
at Logger.rawmsg (C:\Users\m4des\AppData\Roaming\npm\node_modules\@ionic\cli\lib\utils\logger.js:13:14)
at HelpCommand.run (C:\Users\m4des\AppData\Roaming\npm\node_modules\@ionic\cli\commands\help.js:53:26)
at async Promise.all (index 0)
at async HelpCommand.execute (C:\Users\m4des\AppData\Roaming\npm\node_modules\@ionic\cli\lib\command.js:81:9)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4047,
syscall: 'write',
code: 'EPIPE'
}
● Test suite failed to run
SyntaxError: Invalid regular expression: /'node_modules\\(?!(@ionic\\react/: Unterminated group
at new RegExp (<anonymous>)
at calcIgnorePatternRegExp (node_modules/@jest/transform/build/ScriptTransformer.js:1076:10)
at new ScriptTransformer (node_modules/@jest/transform/build/ScriptTransformer.js:231:31)
at createScriptTransformer (node_modules/@jest/transform/build/ScriptTransformer.js:1112:23)
at createTranspilingRequire (node_modules/@jest/transform/build/ScriptTransformer.js:924:29)
at SearchSource._getOrBuildDependencyResolver (node_modules/@jest/core/build/SearchSource.js:227:59)
at SearchSource.findRelatedTests (node_modules/@jest/core/build/SearchSource.js:288:43)
at SearchSource.findTestRelatedToChangedFiles (node_modules/@jest/core/build/SearchSource.js:377:17)
at SearchSource._getTestPaths (node_modules/@jest/core/build/SearchSource.js:386:19)
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
However, after trial and error I found out the issue/fix, it works fine when I replace the single quotes in the command with an escaped double quote like:
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)\"",
Starter Type: React Starter Template: All I think?
Description: When I try to execute the test script on Windows it fails. The strange thing is that it fails if I did
yarn test
ornpm test
but if I copied the exact command in the terminal it works fine!yarn test
even works on WSL which is Windows subsystem for Linux!Here's the error:
However, after trial and error I found out the issue/fix, it works fine when I replace the single quotes in the command with an escaped double quote like:
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)\"",
My
ionic info
:Other Information: