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

Error occurs in fs functions mkdirsSync and mkDirSync…
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
- add jest-stare back since #710 and #774 where resolved by #776 Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com> — committed to zowe/zowe-explorer-vscode by zFernand0 4 years ago
- Refactoring of Job Action Unit Tests (#703) * Added generators for mocks. Moved 2 groups of tests to the proper location. Signed-off-by: Stepan Zharychev <stepan.zharychev@broadcom.com> * Added... — committed to zowe/zowe-explorer-vscode by stepanzharychevbroadcom 4 years ago
The problem went away for me when I modified the arguments passed to Jest in
.vscode/launch.jsonto be identical to the arguments used innpm run test:I am also experiencing this issue but have noticed that running
npm tworks fine. So this must be something to do with VSCode’s debugger