Skip to content

Commit

Permalink
Merge branch 'master' into package-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 16, 2018
2 parents e4a2bd1 + 5c8ec2f commit 2f95001
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"request": "launch",
"name": "Debug Jest with current test file",
"program": "${workspaceFolder}/packages/jest-cli/bin/jest.js",
"args": ["--runInBand", "${file}"]
"args": ["--runInBand", "${file}"],
"runtimeArgs": ["-r", "flow-remove-types/register"]
}
]
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Fixes

- `[jest-haste-map]` [**BREAKING**] Replaced internal data structures to improve performance ([#6960](https://github.com/facebook/jest/pull/6960))
- `[jest-jasmine2]` Fix memory leak in Error objects hold by the framework ([#6965](https://github.com/facebook/jest/pull/6965))

### Chore & Maintenance

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<a href="#backers"><img src="https://opencollective.com/jest/backers/badge.svg" alt="Backers on Open Collective"></a>
<a href="#sponsors"><img src="https://opencollective.com/jest/sponsors/badge.svg" alt="Sponsors on Open Collective"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
<a href="https://snyk.io/test/github/facebook/jest?targetFile=packages/jest/package.json"><img src="https://snyk.io/test/github/facebook/jest/badge.svg?targetFile=packages/jest/package.json" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/github/facebook/jest?targetFile=packages/jest/package.json" style="max-width:100%;"></a>
</p>

**👩🏻‍💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project.
Expand Down
5 changes: 1 addition & 4 deletions jest.config.ci.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
'use strict';

// TODO: Configure the reporter directly: https://github.com/rickhanlonii/jest-silent-reporter/commit/e9a306210f89fa22705823f4c920ed4eecdfb83d#r30109923
process.env.JEST_SILENT_REPORTER_DOTS = true;

// Object spread is just node 8
module.exports = Object.assign({}, require('./jest.config'), {
reporters: [
['jest-junit', {output: 'reports/junit/js-test-results.xml'}],
'jest-silent-reporter',
['jest-silent-reporter', {useDots: true}],
],
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"istanbul-lib-coverage": "^1.0.0",
"jasmine-reporters": "^2.2.0",
"jest-junit": "^5.1.0",
"jest-silent-reporter": "^0.1.0",
"jest-silent-reporter": "^0.1.1",
"jquery": "^3.2.1",
"karma": "^3.0.0",
"karma-browserify": "^5.1.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/jest-jasmine2/src/jasmine/Spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ export default function Spec(attrs: Object) {
this.initError = new Error();
this.initError.name = '';

// Without this line v8 stores references to all closures
// in the stack in the Error object. This line stringifies the stack
// property to allow garbage-collecting objects on the stack
// https://crbug.com/v8/7142
this.initError.stack = this.initError.stack;

this.queueableFn.initError = this.initError;

this.result = {
Expand Down
12 changes: 12 additions & 0 deletions packages/jest-jasmine2/src/jasmine_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ function promisifyLifeCycleFunction(originalFn, env) {

const extraError = new Error();

// Without this line v8 stores references to all closures
// in the stack in the Error object. This line stringifies the stack
// property to allow garbage-collecting objects on the stack
// https://crbug.com/v8/7142
extraError.stack = extraError.stack;

// We make *all* functions async and run `done` right away if they
// didn't return a promise.
const asyncJestLifecycle = function(done) {
Expand Down Expand Up @@ -79,6 +85,12 @@ function promisifyIt(originalFn, env) {

const extraError = new Error();

// Without this line v8 stores references to all closures
// in the stack in the Error object. This line stringifies the stack
// property to allow garbage-collecting objects on the stack
// https://crbug.com/v8/7142
extraError.stack = extraError.stack;

const asyncJestTest = function(done) {
const wrappedFn = isGeneratorFn(fn) ? co.wrap(fn) : fn;
const returnValue = wrappedFn.call({});
Expand Down
1 change: 1 addition & 0 deletions packages/jest-jasmine2/src/queue_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default function queueRunner(options: Options) {
'Timeout - Async callback was not invoked within the ' +
timeoutMs +
'ms timeout specified by jest.setTimeout.';
initError.stack = initError.message + initError.stack;
options.onException(initError);
},
);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6451,7 +6451,7 @@ jest-junit@^5.1.0:
strip-ansi "^4.0.0"
xml "^1.0.1"

jest-silent-reporter@^0.1.0:
jest-silent-reporter@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jest-silent-reporter/-/jest-silent-reporter-0.1.1.tgz#2580704abf6245009f486fbea68f697dd7db2f48"
dependencies:
Expand Down

0 comments on commit 2f95001

Please sign in to comment.