Unable to run Jest stare
CoderCoco opened this issue · comments
CoderCoco commented
Hello
I am having an issue while running jest-stare with no results directory present.
Error: ENOENT: no such file or directory, mkdir '__tests__\__results__\unit\html/'
at Object.mkdirSync (fs.js:753:3)
at Function.mkDirSync (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:26:16)
at dirs.forEach (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:34:16)
at Array.forEach (<anonymous>)
at Function.mkdirsSync (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:32:14)
at Processor.generateReport (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:72:17)
at Processor.generate (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:44:14)
at Function.run (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:28:62)
at Reporter.onRunStart (C:\XXXXXX\node_modules\jest-stare\lib\reporter\Reporter.js:16:31)
at C:\XXXXXX\node_modules\@jest\core\build\ReporterDispatcher.js:165:50
Configuration for Jest is done with an env file:
const path = require("path");
const basePath = "./__tests__/__results__/unit";
const testType = "Unit";
module.exports = {
"FORCE_COLOR": "1",
"JEST_STARE_RESULT_DIR": path.join(basePath, "html"),
"JEST_JUNIT_OUTPUT": path.join(basePath, "junit/junit.xml"),
"JEST_JUNIT_ANCESTOR_SEPARATOR": " > ",
"JEST_JUNIT_CLASSNAME": `${testType}.{classname}`,
"JEST_JUNIT_TITLE": "{title}",
"JEST_SUIT_NAME": `${testType} Tests`
}
If I create that directory prior to running jest, the library works.
jest-stare: 1.15.0
jest: 24.7.1
node: 10.15.1
npm: 6.9.0
Dan Kelosky commented
I'll take a look after vacation. Thanks for reporting!
…On Fri, Jun 14, 2019, 9:41 AM Christopher Wright ***@***.***> wrote:
Hello
I am having an issue while running jest-stare with no results directory
present.
Error: ENOENT: no such file or directory, mkdir '__tests__\__results__\unit\html/'
at Object.mkdirSync (fs.js:753:3)
at Function.mkDirSync (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:26:16)
at dirs.forEach (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:34:16)
at Array.forEach (<anonymous>)
at Function.mkdirsSync (C:\XXXXXX\node_modules\jest-stare\lib\utils\IO.js:32:14)
at Processor.generateReport (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:72:17)
at Processor.generate (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:44:14)
at Function.run (C:\XXXXXX\node_modules\jest-stare\lib\processor\Processor.js:28:62)
at Reporter.onRunStart (C:\XXXXXX\node_modules\jest-stare\lib\reporter\Reporter.js:16:31)
at ***@***.***\core\build\ReporterDispatcher.js:165:50
Configuration for Jest is done with an env file:
const path = require("path");const basePath = "./__tests__/__results__/unit";const testType = "Unit";
module.exports = {
"FORCE_COLOR": "1",
"JEST_STARE_RESULT_DIR": path.join(basePath, "html"),
"JEST_JUNIT_OUTPUT": path.join(basePath, "junit/junit.xml"),
"JEST_JUNIT_ANCESTOR_SEPARATOR": " > ",
"JEST_JUNIT_CLASSNAME": `${testType}.{classname}`,
"JEST_JUNIT_TITLE": "{title}",
"JEST_SUIT_NAME": `${testType} Tests`
}
If I create that directory prior to running jest, the library works.
jest-stare: 1.15.0
jest: 24.7.1
node: 10.15.1
npm: 6.9.0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#105?email_source=notifications&email_token=ADR7TENGGWJ767BSPIH55KLP2O32VA5CNFSM4HYJATTKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZSZICQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADR7TEJ2PZEIN5X6QUBHULDP2O32VANCNFSM4HYJATTA>
.
Dan Kelosky commented
This is fixed by #106
Deleted user commented
I noticed that this commit: 0a7cf86 fixes the problem but it seems to be missing from 1.16.0
ChrisBoehmCA commented
Hmm I see the changes after doing npm pack jest-stare
so it seems to have been published to me...
IO.js:
static mkdirsSync(dir) {
const dirs = path.resolve(dir).replace(/\\/g, "/").split("/");
let createDir = "";
for (const crDir of dirs) {
createDir += (crDir + "/");
IO.mkDirSync(createDir);
}
}