zowe-explorer-vscode: EPERM error when running unit tests locally

When some of us are running unit tests locally, we get an EPERM error caused by the jest-stare reporter

image

Error occurs in fs functions mkdirsSync and mkDirSyncimage const dirs is set to an array: ['C:', 'Users', 'theUser', ...] …and then on line 35 mkDirSync is called with C:/ as the argument, somehow passes the test on line 26, and fs tries to make directory C:/ …and then we get the EPERM error shown above P:

The error does not occur on the following unit tests: extension, DatasetTree, ZoweJobNode, USSTree

But all subsequent tests have the error.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

The problem went away for me when I modified the arguments passed to Jest in .vscode/launch.json to be identical to the arguments used in npm run test:

"args": [
    ".*__tests__.*\\.unit\\.test\\.ts",
    "--coverage"
],

I am also experiencing this issue but have noticed that running npm t works fine. So this must be something to do with VSCode’s debugger