Comparing version 0.5.8 to 0.5.10
@@ -134,2 +134,8 @@ #!/usr/bin/env node | ||
}, | ||
watchExtensions: { | ||
description: _wrapDesc( | ||
'Comma separated list of file extensions to watch, defaults to js.' | ||
), | ||
type: 'string' | ||
}, | ||
bail: { | ||
@@ -159,2 +165,8 @@ alias: 'b', | ||
if (argv.watchExtensions && argv.watch === undefined) { | ||
throw ( | ||
'--watchExtensions can only be specified together with --watch.' | ||
); | ||
} | ||
if (argv.testEnvData) { | ||
@@ -261,4 +273,8 @@ argv.testEnvData = JSON.parse(argv.testEnvData); | ||
var useWatchman = !err && resolvedPath; | ||
var watchExtensions = argv.watchExtensions || 'js'; | ||
var globs = watchExtensions.split(',').map(function(extension) { | ||
return '**/*' + extension; | ||
}); | ||
var watcher = sane(cwdPackageRoot, { | ||
glob: ['**/*.js'], | ||
glob: globs, | ||
watchman: useWatchman | ||
@@ -265,0 +281,0 @@ }); |
{ | ||
"name": "jest-cli", | ||
"description": "Painless JavaScript Unit Testing.", | ||
"version": "0.5.8", | ||
"version": "0.5.10", | ||
"main": "src/jest.js", | ||
@@ -14,4 +14,6 @@ "dependencies": { | ||
"jasmine-pit": "^2.0.2", | ||
"jsdom": "6.5.0", | ||
"jsdom": "6.5.1", | ||
"json-stable-stringify": "^1.0.0", | ||
"lodash.template": "^3.6.2", | ||
"mkdirp": "^0.5.1", | ||
"node-haste": "^1.2.8", | ||
@@ -22,4 +24,4 @@ "node-worker-pool": "^3.0.2", | ||
"resolve": "^1.1.6", | ||
"sane": "^1.2.0", | ||
"through": "^2.3.8", | ||
"sane": "^1.2.0", | ||
"which": "^1.1.1" | ||
@@ -26,0 +28,0 @@ }, |
@@ -20,2 +20,3 @@ /** | ||
var hasteLoaders = require('node-haste/lib/loaders'); | ||
var mkdirp = require('mkdirp'); | ||
var moduleMocker = require('../lib/moduleMocker'); | ||
@@ -87,10 +88,12 @@ var NodeHaste = require('node-haste/lib/Haste'); | ||
var HASTE_IGNORE_REGEX = new RegExp( | ||
config.modulePathIgnorePatterns.length > 0 | ||
? config.modulePathIgnorePatterns.join('|') | ||
: '$.' // never matches | ||
[config.cacheDirectory].concat(config.modulePathIgnorePatterns).join('|') | ||
); | ||
if (!fs.existsSync(config.cacheDirectory)) { | ||
fs.mkdirSync(config.cacheDirectory); | ||
fs.chmodSync(config.cacheDirectory, '777'); | ||
// Support npm package scopes that add an extra directory to the path | ||
var scopedCacheDirectory = path.dirname(_getCacheFilePath(config)); | ||
if (!fs.existsSync(scopedCacheDirectory)) { | ||
mkdirp.sync(scopedCacheDirectory, { | ||
mode: '777', | ||
fs: fs, | ||
}); | ||
} | ||
@@ -604,6 +607,8 @@ | ||
var realPath = fs.realpathSync(modulePath); | ||
this._configShouldMockModuleNames[moduleName] = true; | ||
for (var i = 0; i < this._unmockListRegExps.length; i++) { | ||
unmockRegExp = this._unmockListRegExps[i]; | ||
if (unmockRegExp.test(modulePath)) { | ||
if (unmockRegExp.test(modulePath) || | ||
unmockRegExp.test(realPath)) { | ||
return this._configShouldMockModuleNames[moduleName] = false; | ||
@@ -620,5 +625,3 @@ } | ||
Loader.prototype.constructBoundRequire = function(unresolvedModulePath) { | ||
var modulePath = fs.realpathSync(unresolvedModulePath); | ||
Loader.prototype.constructBoundRequire = function(modulePath) { | ||
var boundModuleRequire = | ||
@@ -625,0 +628,0 @@ this.requireModuleOrMock.bind(this, modulePath); |
@@ -8,4 +8,3 @@ /** | ||
*/ | ||
// This module uses the Function constructor, so it can't currently run | ||
// in strict mode | ||
/* jshint strict:false */ | ||
@@ -12,0 +11,0 @@ |
@@ -14,2 +14,3 @@ /** | ||
var path = require('path'); | ||
var stringify = require('json-stable-stringify'); | ||
@@ -365,2 +366,5 @@ var DEFAULT_CONFIG_VALUES = { | ||
// To avoid stringifiying the config multiple times | ||
var configToJsonMap = new Map(); | ||
// There are two layers of caching: in memory (always enabled), | ||
@@ -429,6 +433,12 @@ // and on disk (enabled by default, and managed by the | ||
} else { | ||
var configStr = configToJsonMap.get(config); | ||
if (!configStr) { | ||
configStr = stringify(config); | ||
configToJsonMap.set(config, configStr); | ||
} | ||
// Default cache hashing. | ||
cacheKey = crypto.createHash('md5') | ||
.update(fileData) | ||
.update(JSON.stringify(config)) | ||
.update(configStr) | ||
.digest('hex'); | ||
@@ -435,0 +445,0 @@ } |
@@ -525,2 +525,3 @@ /** | ||
tests: {}, | ||
testResults: {}, | ||
logMessages: [] | ||
@@ -527,0 +528,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
381731
70
9321
19
+ Addedjson-stable-stringify@^1.0.0
+ Addedmkdirp@^0.5.1
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddunder-proto@1.0.0(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedget-intrinsic@1.2.5(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedjsdom@6.5.1(transitive)
+ Addedjson-stable-stringify@1.1.1(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
- Removedjsdom@6.5.0(transitive)
Updatedjsdom@6.5.1