Comparing version 0.1.9 to 0.1.10
@@ -19,2 +19,3 @@ #!/usr/bin/env node | ||
var TestRunner = require('../src/TestRunner'); | ||
var colors = require('../src/lib/colors'); | ||
var utils = require('../src/lib/utils'); | ||
@@ -73,6 +74,15 @@ | ||
var numTotalTests = completionData.numTotalTests; | ||
var numPassedTests = numTotalTests - numFailedTests; | ||
var startTime = completionData.startTime; | ||
var endTime = completionData.endTime; | ||
console.log(numFailedTests + '/' + numTotalTests + ' tests failed'); | ||
var results = ''; | ||
if (numFailedTests) { | ||
results += colors.colorize(numFailedTests + ' tests failed', colors.RED + colors.BOLD) + ', '; | ||
} | ||
results += | ||
colors.colorize(numPassedTests + ' tests passed', colors.GREEN + colors.BOLD) + | ||
' (' + numTotalTests + ' total)'; | ||
console.log(results); | ||
console.log('Run time: ' + ((endTime - startTime) / 1000) + 's'); | ||
@@ -305,2 +315,6 @@ process.exit(numFailedTests ? 1 : 0); | ||
// Is there a package.json at our cwdPackageRoot that indicates that there | ||
// should be a version of Jest installed? | ||
var cwdPkgJsonPath = path.join(cwdPackageRoot, 'package.json'); | ||
// Is there a version of Jest installed at our cwdPackageRoot? | ||
@@ -310,10 +324,7 @@ var cwdJestBinPath = path.join( | ||
'node_modules', | ||
'.bin', | ||
'jest' | ||
'jest-cli', | ||
'bin', | ||
'jest.js' | ||
); | ||
// Is there a package.json at our cwdPackageRoot that indicates that there | ||
// should be a version of Jest installed? | ||
var cwdPkgJsonPath = path.join(cwdPackageRoot, 'package.json'); | ||
// If a version of Jest was found installed in the CWD package, run using that | ||
@@ -320,0 +331,0 @@ if (fs.existsSync(cwdJestBinPath)) { |
{ | ||
"name": "jest-cli", | ||
"description": "Painless JavaScript Unit Testing.", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "coffee-script": "1.7.1", |
@@ -466,2 +466,21 @@ /** | ||
if (NODE_CORE_MODULES[moduleName]) { | ||
return null; | ||
} | ||
var resolveError = null; | ||
try { | ||
return resolve.sync(moduleName, { | ||
basedir: path.dirname(currPath), | ||
extensions: ['.js', '.json'] | ||
}); | ||
} catch (e) { | ||
// Facebook has clowny package.json resolution rules that don't apply to | ||
// regular Node rules. Until we can make ModuleLoaders more pluggable | ||
// (so that FB can have a custom ModuleLoader and all the normal people can | ||
// have a normal ModuleLoader), we catch node-resolution exceptions and | ||
// fall back to some custom resolution logic before throwing the error. | ||
resolveError = e; | ||
} | ||
// Memoize the project name -> package.json resource lookup map | ||
@@ -480,6 +499,3 @@ if (this._nodeModuleProjectConfigNameToResource === null) { | ||
if (!resource) { | ||
if (NODE_CORE_MODULES[moduleName]) { | ||
return null; | ||
} | ||
return resolve.sync(moduleName, {basedir: path.dirname(currPath)}); | ||
throw resolveError; | ||
} | ||
@@ -492,3 +508,3 @@ | ||
if (resourceDirname.indexOf(currFileDirname) > 0) { | ||
return resolve.sync(moduleName, {basedir: path.dirname(currPath)}); | ||
throw resolveError; | ||
} | ||
@@ -495,0 +511,0 @@ |
@@ -12,2 +12,3 @@ /** | ||
var GRAY = '\x1B[90m'; | ||
var GREEN = '\x1B[32m'; | ||
var GREEN_BG = '\x1B[42m'; | ||
@@ -26,2 +27,3 @@ var MAGENTA_BG = '\x1B[45m'; | ||
exports.GRAY = GRAY; | ||
exports.GREEN = GREEN; | ||
exports.GREEN_BG = GREEN_BG; | ||
@@ -28,0 +30,0 @@ exports.MAGENTA_BG = MAGENTA_BG; |
@@ -357,2 +357,3 @@ /** | ||
__filename: config.setupEnvScriptFile, | ||
global: env.global, | ||
require: moduleLoader.constructBoundRequire( | ||
@@ -359,0 +360,0 @@ config.setupEnvScriptFile |
Sorry, the diff of this file is not supported yet
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
290578
49
7574