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

[6.x] Upgrade to Jest 23.5.0 (#22791) #22846

Merged
merged 1 commit into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"@types/glob": "^5.0.35",
"@types/hapi-latest": "npm:@types/hapi@17.0.12",
"@types/has-ansi": "^3.0.0",
"@types/jest": "^22.2.3",
"@types/jest": "^23.3.1",
"@types/joi": "^10.4.4",
"@types/jquery": "3.3.1",
"@types/js-yaml": "^3.11.1",
Expand All @@ -260,7 +260,7 @@
"@types/type-detect": "^4.0.1",
"angular-mocks": "1.4.7",
"babel-eslint": "8.1.2",
"babel-jest": "^22.4.3",
"babel-jest": "^23.4.2",
"backport": "4.2.0",
"chai": "3.5.0",
"chance": "1.0.10",
Expand All @@ -276,7 +276,7 @@
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-babel": "4.1.2",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jest": "^21.6.2",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-mocha": "4.11.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "1.2.1",
Expand All @@ -301,8 +301,8 @@
"husky": "0.8.1",
"image-diff": "1.6.0",
"istanbul-instrumenter-loader": "3.0.0",
"jest": "^22.4.3",
"jest-cli": "^22.4.3",
"jest": "^23.5.0",
"jest-cli": "^23.5.0",
"jest-raw-loader": "^1.0.1",
"jimp": "0.2.28",
"jsdom": "9.9.1",
Expand Down Expand Up @@ -338,7 +338,7 @@
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"tree-kill": "^1.1.0",
"ts-jest": "^22.4.6",
"ts-jest": "^23.1.4",
"ts-loader": "^3.5.0",
"ts-node": "^6.0.3",
"tslint": "^5.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"eslint": "^4.1.0",
"eslint-plugin-babel": "^4.1.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^21.0.0",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-mocha": "^4.9.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"eslint": "^4.11.0",
"eslint-plugin-babel": "^4.1.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-jest": "^21.3.2",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-mocha": "^4.9.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/globby": "^6.1.0",
"@types/has-ansi": "^3.0.0",
"@types/indent-string": "^3.0.0",
"@types/jest": "^22.1.3",
"@types/jest": "^23.3.1",
"@types/lodash.clonedeepwith": "^4.5.3",
"@types/log-symbols": "^2.0.0",
"@types/mkdirp": "^0.5.2",
Expand Down
13 changes: 3 additions & 10 deletions packages/kbn-pm/src/commands/bootstrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const noop = () => {

afterEach(() => {
jest.resetAllMocks();
jest.restoreAllMocks();
});

test('handles dependencies of dependencies', async () => {
Expand Down Expand Up @@ -96,8 +97,6 @@ test('handles dependencies of dependencies', async () => {
rootPath: '',
});

logMock.mockRestore();

expect(mockInstallInDir.mock.calls).toMatchSnapshot('install in dir');
expect(logMock.mock.calls).toMatchSnapshot('logs');
});
Expand Down Expand Up @@ -127,8 +126,6 @@ test('does not run installer if no deps in package', async () => {
rootPath: '',
});

logMock.mockRestore();

expect(mockInstallInDir.mock.calls).toMatchSnapshot('install in dir');
expect(logMock.mock.calls).toMatchSnapshot('logs');
});
Expand All @@ -143,7 +140,7 @@ test('handles "frozen-lockfile"', async () => {
const projects = new Map([['kibana', kibana]]);
const projectGraph = buildProjectGraph(projects);

const logMock = jest.spyOn(console, 'log').mockImplementation(noop);
jest.spyOn(console, 'log').mockImplementation(noop);

await BootstrapCommand.run(projects, projectGraph, {
extraArgs: [],
Expand All @@ -153,8 +150,6 @@ test('handles "frozen-lockfile"', async () => {
rootPath: '',
});

logMock.mockRestore();

expect(mockInstallInDir.mock.calls).toMatchSnapshot('install in dir');
});

Expand All @@ -177,16 +172,14 @@ test('calls "kbn:bootstrap" scripts and links executables after installing deps'
const projects = new Map([['kibana', kibana], ['bar', bar]]);
const projectGraph = buildProjectGraph(projects);

const logMock = jest.spyOn(console, 'log').mockImplementation(noop);
jest.spyOn(console, 'log').mockImplementation(noop);

await BootstrapCommand.run(projects, projectGraph, {
extraArgs: [],
options: {},
rootPath: '',
});

logMock.mockRestore();

expect(mockLinkProjectExecutables.mock.calls).toMatchSnapshot('link bins');
expect(mockRunScriptInPackageStreaming.mock.calls).toMatchSnapshot('script');
});
2 changes: 1 addition & 1 deletion packages/kbn-pm/src/utils/link_project_executables.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ expect.addSnapshotSerializer(stripAnsiSnapshotSerializer);

afterEach(() => {
jest.resetAllMocks();
jest.restoreAllMocks();
});

describe('bin script points nowhere', () => {
Expand All @@ -102,7 +103,6 @@ describe('bin script points to a file', () => {
// noop
});
await linkProjectExecutables(projectsByName, projectGraph);
logMock.mockRestore();

expect(getFsMockCalls()).toMatchSnapshot('fs module calls');
expect(logMock.mock.calls).toMatchSnapshot('logs');
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-pm/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/indent-string/-/indent-string-3.0.0.tgz#9ebb391ceda548926f5819ad16405349641b999f"

"@types/jest@^22.1.3":
version "22.1.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.1.3.tgz#25da391935e6fac537551456f077ce03144ec168"
"@types/jest@^23.3.1":
version "23.3.1"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.1.tgz#a4319aedb071d478e6f407d1c4578ec8156829cf"

"@types/lodash.clonedeepwith@^4.5.3":
version "4.5.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-system-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:bootstrap": "yarn build"
},
"devDependencies": {
"@types/jest": "^22.2.2",
"@types/jest": "^23.3.1",
"typescript": "^2.9.2"
}
}
6 changes: 3 additions & 3 deletions packages/kbn-system-loader/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# yarn lockfile v1


"@types/jest@^22.2.2":
version "22.2.2"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.2.2.tgz#afe5dacbd00d65325f52da0ed3e76e259629ac9d"
"@types/jest@^23.3.1":
version "23.3.1"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.1.tgz#a4319aedb071d478e6f407d1c4578ec8156829cf"

typescript@^2.9.2:
version "2.9.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Array [
"starting legacy service",
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
],
},
"error": [MockFunction],
"fatal": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ exports[`Inspector Data View component should render empty state 1`] = `
>
<EuiEmptyPrompt
body={
<UNDEFINED>
<React.Fragment>
<p>
The element did not provide any data.
</p>
</UNDEFINED>
</React.Fragment>
}
iconColor="subdued"
title={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = `
</EuiButton>
}
body={
<UNDEFINED>
<React.Fragment>
<p>
You can combine data views from any Kibana app into one dashboard and see everything in one place.
</p>
Expand All @@ -227,7 +227,7 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = `
</EuiLink>
to take a test drive.
</p>
</UNDEFINED>
</React.Fragment>
}
iconColor="subdued"
iconType="dashboardApp"
Expand Down
Loading