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

chore: upgrade dependencies #8372

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"jest-junit": "^6.2.1",
"jest-silent-reporter": "^0.1.2",
"jest-snapshot-serializer-raw": "^1.1.0",
"jest-watch-typeahead": "^0.3.0",
"jquery": "^3.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "^2.1.1",
Expand Down Expand Up @@ -135,7 +136,6 @@
]
},
"dependencies": {
"jest-watch-typeahead": "^0.2.2-0",
"opencollective": "^1.0.3"
},
"collective": {
Expand Down
68 changes: 35 additions & 33 deletions packages/expect/src/__tests__/spyMatchers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ const jestExpect = require('../');
}).toThrowErrorMatchingSnapshot();
});

test(`incomplete recursive calls are handled properly`, () => {
test('incomplete recursive calls are handled properly', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// sums up all integers from 0 -> value, using recursion
const fn = jest.fn(value => {
if (value === 0) {
Expand Down Expand Up @@ -988,7 +988,7 @@ const jestExpect = require('../');
}).toThrowErrorMatchingSnapshot();
});

test(`incomplete recursive calls are handled properly`, () => {
test(`${returnedWith} incomplete recursive calls are handled properly`, () => {
// sums up all integers from 0 -> value, using recursion
const fn = jest.fn(value => {
if (value === 0) {
Expand Down Expand Up @@ -1027,43 +1027,45 @@ const jestExpect = require('../');

const lastReturnedWith = ['toHaveLastReturnedWith', 'lastReturnedWith'];
if (lastReturnedWith.indexOf(returnedWith) >= 0) {
test(`works with three calls`, () => {
const fn = jest.fn();
fn.mockReturnValueOnce('foo1');
fn.mockReturnValueOnce('foo2');
fn.mockReturnValueOnce('foo3');
fn();
fn();
fn();

jestExpect(fn)[returnedWith]('foo3');
describe('lastReturnedWith', () => {
test('works with three calls', () => {
const fn = jest.fn();
fn.mockReturnValueOnce('foo1');
fn.mockReturnValueOnce('foo2');
fn.mockReturnValueOnce('foo3');
fn();
fn();
fn();

jestExpect(fn)[returnedWith]('foo3');

expect(() => {
jestExpect(fn).not[returnedWith]('foo3');
}).toThrowErrorMatchingSnapshot();
});

expect(() => {
jestExpect(fn).not[returnedWith]('foo3');
}).toThrowErrorMatchingSnapshot();
});
test('incomplete recursive calls are handled properly', () => {
// sums up all integers from 0 -> value, using recursion
const fn = jest.fn(value => {
if (value === 0) {
// Before returning from the base case of recursion, none of the
// calls have returned yet.
jestExpect(fn).not[returnedWith](0);
expect(() =>
jestExpect(fn)[returnedWith](0),
).toThrowErrorMatchingSnapshot();
return 0;
} else {
return value + fn(value - 1);
}
});

test(`incomplete recursive calls are handled properly`, () => {
// sums up all integers from 0 -> value, using recursion
const fn = jest.fn(value => {
if (value === 0) {
// Before returning from the base case of recursion, none of the
// calls have returned yet.
jestExpect(fn).not[returnedWith](0);
expect(() =>
jestExpect(fn)[returnedWith](0),
).toThrowErrorMatchingSnapshot();
return 0;
} else {
return value + fn(value - 1);
}
fn(3);
});

fn(3);
});
}

test(`includes the custom mock name in the error message`, () => {
test('includes the custom mock name in the error message', () => {
const fn = jest.fn().mockName('named-mock');
caller(jestExpect(fn).not[returnedWith], 'foo');

Expand Down
4 changes: 2 additions & 2 deletions packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"jest-validate": "^24.7.0",
"prompts": "^2.0.1",
"realpath-native": "^1.1.0",
"yargs": "^12.0.2"
"yargs": "^13.2.2"
},
"devDependencies": {
"@types/exit": "^0.1.30",
"@types/is-ci": "^1.1.0",
"@types/prompts": "^1.2.0",
"@types/yargs": "^12.0.2"
"@types/yargs": "^13.0.0"
},
"bin": {
"jest": "./bin/jest.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"jest-runtime": "^24.7.1",
"jest-validate": "^24.7.0",
"repl": "^0.1.3",
"yargs": "^12.0.2"
"yargs": "^13.2.2"
},
"devDependencies": {
"@types/yargs": "^12.0.2"
"@types/yargs": "^13.0.0"
},
"bin": {
"jest-repl": "./bin/jest-repl.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@jest/source-map": "^24.3.0",
"@jest/transform": "^24.7.1",
"@jest/types": "^24.7.0",
"@types/yargs": "^12.0.2",
"@types/yargs": "^13.0.0",
"chalk": "^2.0.1",
"exit": "^0.1.2",
"glob": "^7.1.3",
Expand All @@ -32,7 +32,7 @@
"realpath-native": "^1.1.0",
"slash": "^2.0.0",
"strip-bom": "^3.0.0",
"yargs": "^12.0.2"
"yargs": "^13.2.2"
},
"devDependencies": {
"@types/exit": "^0.1.30",
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
"pretty-format": "^24.7.0",
"semver": "^5.5.0"
"semver": "^6.0.0"
},
"devDependencies": {
"@babel/traverse": "^7.3.4",
"@types/mkdirp": "^0.5.2",
"@types/natural-compare": "^1.4.0",
"@types/prettier": "^1.16.1",
"@types/semver": "^5.5.0",
"@types/semver": "^6.0.0",
"jest-haste-map": "^24.7.1",
"prettier": "^1.13.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ exports[`ScriptTransformer transforms a file properly 1`] = `
var cov_25u22311x4 = function () {
var path = \\"/fruits/banana.js\\";
var hash = \\"ef12c7f3c0d46c0ac007781d50b4e524293578c6\\";

var Function = function () {}.constructor;

var global = new Function(\\"return this\\")();
var gcv = \\"__coverage__\\";
var coverageData = {
Expand All @@ -105,15 +102,15 @@ var cov_25u22311x4 = function () {
},
f: {},
b: {},
_coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\"
_coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\",
hash: \\"ef12c7f3c0d46c0ac007781d50b4e524293578c6\\"
};
var coverage = global[gcv] || (global[gcv] = {});

if (coverage[path] && coverage[path].hash === hash) {
return coverage[path];
}

coverageData.hash = hash;
return coverage[path] = coverageData;
}();

Expand All @@ -127,9 +124,6 @@ exports[`ScriptTransformer transforms a file properly 2`] = `
var cov_23yvu8etmu = function () {
var path = \\"/fruits/kiwi.js\\";
var hash = \\"90cf6273dfbcd93e4510a6c5503c2125aab1f1b8\\";

var Function = function () {}.constructor;

var global = new Function(\\"return this\\")();
var gcv = \\"__coverage__\\";
var coverageData = {
Expand Down Expand Up @@ -191,15 +185,15 @@ var cov_23yvu8etmu = function () {
\\"0\\": 0
},
b: {},
_coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\"
_coverageSchema: \\"43e27e138ebf9cfc5966b082cf9a028302ed4184\\",
hash: \\"90cf6273dfbcd93e4510a6c5503c2125aab1f1b8\\"
};
var coverage = global[gcv] || (global[gcv] = {});

if (coverage[path] && coverage[path].hash === hash) {
return coverage[path];
}

coverageData.hash = hash;
return coverage[path] = coverageData;
}();

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^1.1.1",
"@types/yargs": "^12.0.9"
"@types/yargs": "^13.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
36 changes: 18 additions & 18 deletions packages/jest-util/src/__tests__/deepCyclicCopy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ it('uses the blacklist to avoid copying properties on the first level', () => {

it('does not keep the prototype by default when top level is object', () => {
// @ts-ignore
const sourceObject = new function() {}();
const sourceObject = new (function() {})();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// @ts-ignore
sourceObject.nestedObject = new function() {}();
sourceObject.nestedObject = new (function() {})();
// @ts-ignore
sourceObject.nestedArray = new function() {
sourceObject.nestedArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const spy = jest
.spyOn(Array, 'isArray')
Expand Down Expand Up @@ -125,10 +125,10 @@ it('does not keep the prototype by default when top level is array', () => {
const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true);

// @ts-ignore
const sourceArray = new function() {
const sourceArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const copy = deepCyclicCopy(sourceArray);
expect(Object.getPrototypeOf(copy)).not.toBe(
Expand All @@ -143,10 +143,10 @@ it('does not keep the prototype of arrays when keepPrototype = false', () => {
const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true);

// @ts-ignore
const sourceArray = new function() {
const sourceArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const copy = deepCyclicCopy(sourceArray, {keepPrototype: false});
expect(Object.getPrototypeOf(copy)).not.toBe(
Expand All @@ -161,10 +161,10 @@ it('keeps the prototype of arrays when keepPrototype = true', () => {
const spy = jest.spyOn(Array, 'isArray').mockImplementation(() => true);

// @ts-ignore
const sourceArray = new function() {
const sourceArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const copy = deepCyclicCopy(sourceArray, {keepPrototype: true});
expect(Object.getPrototypeOf(copy)).toBe(Object.getPrototypeOf(sourceArray));
Expand All @@ -174,14 +174,14 @@ it('keeps the prototype of arrays when keepPrototype = true', () => {

it('does not keep the prototype for objects when keepPrototype = false', () => {
// @ts-ignore
const sourceobject = new function() {}();
const sourceobject = new (function() {})();
// @ts-ignore
sourceobject.nestedObject = new function() {}();
sourceobject.nestedObject = new (function() {})();
// @ts-ignore
sourceobject.nestedArray = new function() {
sourceobject.nestedArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const spy = jest
.spyOn(Array, 'isArray')
Expand Down Expand Up @@ -211,14 +211,14 @@ it('does not keep the prototype for objects when keepPrototype = false', () => {

it('keeps the prototype for objects when keepPrototype = true', () => {
// @ts-ignore
const sourceObject = new function() {}();
const sourceObject = new (function() {})();
// @ts-ignore
sourceObject.nestedObject = new function() {}();
sourceObject.nestedObject = new (function() {})();
// @ts-ignore
sourceObject.nestedArray = new function() {
sourceObject.nestedArray = new (function() {
// @ts-ignore
this.length = 0;
}();
})();

const spy = jest
.spyOn(Array, 'isArray')
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-validate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"camelcase": "^5.0.0",
"chalk": "^2.0.1",
"jest-get-type": "^24.3.0",
"leven": "^2.1.0",
"leven": "^3.1.0",
"pretty-format": "^24.7.0"
},
"devDependencies": {
"@types/camelcase": "^4.1.0",
"@types/leven": "^2.1.1"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leven comes with type defs now

"@types/camelcase": "^4.1.0"
},
"engines": {
"node": ">= 6"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@jest/test-result": "^24.7.1",
"@jest/types": "^24.7.0",
"@types/yargs": "^12.0.9",
"@types/yargs": "^13.0.0",
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.1",
"jest-util": "^24.7.1",
Expand Down
Loading