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

Haste2 #599

Merged
merged 41 commits into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1a418ef
Initial implementation of the node-haste2 resolver.
cpojer Nov 10, 2015
b237305
Rename and cleanups in HasteModuleLoader
cpojer Nov 10, 2015
a841f2f
Remove __getJestRuntimeForTest.
cpojer Nov 10, 2015
6efc108
Add test for making sure requires in manual mocks are resolvable.
cpojer Nov 11, 2015
6ce50ca
Fix `buildLoader` call in tests to only resolve dependencies once (bu…
cpojer Nov 11, 2015
c78a6d8
* Resolve mocks and mock dependencies properly through node-haste2
cpojer Nov 11, 2015
4f76713
Remove `_getResource`; split into `_getModule` and `_getMockModule`.
cpojer Nov 11, 2015
b82a981
Use node-haste2 to look up manual mocks.
cpojer Nov 11, 2015
77e0893
Stop using `_resourceMap` inside of HasteModuleLoader.
cpojer Nov 12, 2015
95d6d99
Goodbye node-haste, say hello to node-haste2!
cpojer Nov 12, 2015
9e8637a
Fix all the lint errors that came up so far :)
cpojer Nov 12, 2015
3bee143
Mocks are now part of the ResolutionResponse.
cpojer Nov 12, 2015
3e4782e
Add HasteResolver class with a single store to the same dependency gr…
cpojer Nov 12, 2015
781585a
Get rid of all the hasOwnProperty checks in HasteModuleLoader.
cpojer Nov 12, 2015
88396f2
Reorganize all methods in HasteModuleLoader; it is now a readable file!
cpojer Nov 13, 2015
5a1a457
Freeze the config object in the test runner and don’t mutate it any l…
cpojer Nov 13, 2015
1ea7d1e
New and fixed implementation for `jest —onlyChanged`:
cpojer Nov 13, 2015
2cef024
Use alpha version of node-haste; update jest version and changelog
cpojer Nov 14, 2015
df4804b
Make mocks folder configurable (like the tests folder).
cpojer Nov 17, 2015
fb018e0
Use `Object.create(null)` in HasteResolver.
cpojer Nov 17, 2015
bfbef68
Fixes for jasmine2 support with the new node-haste.
cpojer Dec 7, 2015
984ead6
jasmine2 is now the default for jest itself.
cpojer Dec 15, 2015
0c66ddc
Only construct a single HasteResolver instance per TestRunner.
cpojer Dec 15, 2015
1c2834f
Remove access to the resolver from the ModuleLoader; build the entire…
cpojer Dec 18, 2015
4132f9e
node-haste updates.
cpojer Jan 5, 2016
2fcc121
Update the jsdom test.
cpojer Jan 13, 2016
bb1db33
Properly `end` the resolver sessions.
cpojer Jan 14, 2016
7a8aa36
Resolve module mappings properly.
cpojer Jan 14, 2016
af64d93
Fix some checks in the ModuleLoader.
cpojer Jan 21, 2016
0b39b9b
Only create a single HasteResolver for all threads.
cpojer Jan 21, 2016
462196b
Split up TestRunner and a single test run.
cpojer Jan 22, 2016
1829692
Cache resolution responses inside of Jest.
cpojer Jan 27, 2016
4a703de
Faster implementation of changed test path detection.
cpojer Feb 1, 2016
06c5bd7
* Catch resolver errors
cpojer Feb 2, 2016
f381030
Only resolve one test path at a time.
cpojer Feb 3, 2016
b6eb94c
node-haste2 usage inside of Jest is pivoting!
cpojer Feb 4, 2016
e014290
Provide two implementations of changed test path resolution.
cpojer Feb 5, 2016
d47d677
Various performance adjustments.
cpojer Feb 8, 2016
35a7a2f
Properly fix runtime error handling, at last.
cpojer Feb 10, 2016
1b32beb
Fix code coverage.
cpojer Feb 10, 2016
8b8ecb9
Fix TestRunner test.
cpojer Feb 10, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## master

## 0.9.0

* New implementation of node-haste and rewrite of internal module loading and
resolution.

## 0.8.2

* Performance improvements.
Expand Down
2 changes: 1 addition & 1 deletion bin/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

const fs = require('fs');
const fs = require('graceful-fs');
const optimist = require('optimist');
const path = require('path');

Expand Down
6 changes: 6 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ permalink: docs/api.html
- [`config.collectCoverage` [boolean]](#config-collectcoverage-boolean)
- [`config.collectCoverageOnlyFrom` [object]](#config-collectcoverageonlyfrom-object)
- [`config.globals` [object]](#config-globals-object)
- [`config.mocksPattern` [string]](#config-mockspattern-string)
- [`config.moduleFileExtensions` [array<string>]](#config-modulefileextensions-array-string)
- [`config.modulePathIgnorePatterns` [array<string>]](#config-modulepathignorepatterns-array-string)
- [`config.moduleNameMapper` [object<string, string>]](#config-modulenamemapper-object-string-string)
Expand Down Expand Up @@ -317,6 +318,11 @@ For example, the following would create a global `__DEV__` variable set to `true

Note that, if you specify a global reference value (like an object or array) here, and some code mutates that value in the midst of running a test, that mutation will *not* be persisted across test runs for other test files.

### `config.mocksPattern` [string]
(default: `(?:[\\/]|^)__mocks__[\\/]`)

A pattern that is matched against file paths to determine which folder contains manual mocks.

### `config.moduleFileExtensions` [array<string>]
(default: `['js', 'json', 'node']`)

Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "jest-cli",
"description": "Painless JavaScript Unit Testing.",
"version": "0.8.2",
"version": "0.9.0",
"main": "src/jest.js",
"dependencies": {
"chalk": "^1.1.1",
"cover": "^0.2.9",
"diff": "^2.1.1",
"graceful-fs": "^4.1.2",
"fast-path": "^1.1.0",
"graceful-fs": "^4.1.3",
"istanbul": "^0.4.2",
"jsdom": "^7.2.0",
"json-stable-stringify": "^1.0.0",
"lodash.template": "^3.6.2",
"mkdirp": "^0.5.1",
"node-haste": "^1.2.8",
"object-assign": "^4.0.1",
"node-haste": "2.0.0-alpha18",
"optimist": "^0.6.1",
"resolve": "^1.1.6",
"sane": "^1.2.0",
Expand All @@ -38,12 +39,12 @@
"scripts": {
"lint": "eslint .",
"prepublish": "npm test",
"test": "npm run lint && npm run jasmine1 && npm run jasmine2",
"jasmine1": "node bin/jest.js --testRunner='<rootDir>/testRunners/jasmine/jasmine1.js'",
"jasmine2": "node bin/jest.js --testRunner='<rootDir>/testRunners/jasmine/jasmine2.js'"
"test": "npm run lint && node bin/jest.js && npm run jasmine1",
"jasmine1": "node bin/jest.js --testRunner='<rootDir>/testRunners/jasmine/jasmine1.js'"
},
"jest": {
"rootDir": "src",
"testRunner": "<rootDir>/testRunners/jasmine/jasmine2.js",
"testPathIgnorePatterns": [
"/__tests__/[^/]*/.+"
],
Expand Down
Loading