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

Unable to run Jest stare #105

Closed
CoderCoco opened this issue Jun 14, 2019 · 4 comments
Closed

Unable to run Jest stare #105

CoderCoco opened this issue Jun 14, 2019 · 4 comments

Comments

@CoderCoco
Copy link

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

@dkelosky
Copy link
Owner

dkelosky commented Jun 14, 2019 via email

@dkelosky
Copy link
Owner

This is fixed by #106

@ghost
Copy link

ghost commented Jul 8, 2019

I noticed that this commit: 0a7cf86 fixes the problem but it seems to be missing from 1.16.0

@ChrisBoehmCA
Copy link

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);
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants