atom-test-runner-jest
Advanced tools
Comparing version 0.1.3 to 0.2.0
28
index.js
"use babel"; | ||
import { runCLI } from "jest-cli"; | ||
const tmp = require("tmp"); | ||
const pkgUp = require("pkg-up"); | ||
const remote = require("electron").remote; | ||
@@ -9,20 +12,33 @@ export default ({ | ||
logFile, | ||
testPaths | ||
testPaths, | ||
headless | ||
}) => { | ||
const cwd = pkgUp.sync(testPaths[0]); | ||
global.atom = buildAtomEnvironment({ | ||
applicationDelegate: buildDefaultApplicationDelegate(), | ||
window, | ||
document: window.document, | ||
configDirPath: process.env.ATOM_HOME, | ||
document, | ||
configDirPath: tmp.dirSync().name, | ||
enablePersistence: false | ||
}); | ||
if (headless) { | ||
Object.defineProperties(process, { | ||
stdout: { value: remote.process.stdout }, | ||
stderr: { value: remote.process.stderr } | ||
}); | ||
} else { | ||
process.on("uncaughtException", console.error.bind(console)); | ||
} | ||
return runCLI( | ||
{ | ||
cache: false, | ||
cache: true, | ||
_: testPaths, | ||
outputFile: logFile | ||
outputFile: logFile, | ||
runInBand: true | ||
}, | ||
[process.cwd()] | ||
[cwd] | ||
).then(resp => (resp.results.success ? 0 : 1)); | ||
}; |
{ | ||
"name": "atom-test-runner-jest", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Atom Test Runner for Jest", | ||
@@ -24,4 +24,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"jest-cli": "^22.0.3" | ||
"jest-cli": "^22.0.3", | ||
"pkg-up": "^2.0.0", | ||
"tmp": "^0.0.33" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # atom-test-runner-jest | ||
``` | ||
npm install atom-test-runner-jest --save-dev | ||
npm install atom-test-runner-jest jest-preset-atom --save-dev | ||
``` | ||
@@ -14,3 +14,3 @@ | ||
Add the following line to your `package.json`: | ||
Add the following to your `package.json`: | ||
@@ -20,5 +20,6 @@ ```json | ||
"name": "my-package", | ||
// ... | ||
+ "atomTestRunner": "atom-test-runner-jest", | ||
// ... | ||
"atomTestRunner": "atom-test-runner-jest", | ||
"jest": { | ||
"preset": "jest-preset-atom" | ||
} | ||
} | ||
@@ -25,0 +26,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2392
38
40
0
3
+ Addedpkg-up@^2.0.0
+ Addedtmp@^0.0.33
+ Addedpkg-up@2.0.0(transitive)
+ Addedtmp@0.0.33(transitive)