Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ npm-debug.log*
## @cypress/snapshot from apm plugin
/snapshots.js

# transpiled cypress config
x-pack/plugins/fleet/cypress.config.d.ts
x-pack/plugins/fleet/cypress.config.js
x-pack/plugins/osquery/cypress.config.d.ts
x-pack/plugins/osquery/cypress.config.js

# release notes script output
report.csv
report.asciidoc
Expand Down
51 changes: 24 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@
"he": "^1.2.0",
"history": "^4.9.0",
"hjson": "3.2.1",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^5.0.0",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
"i18n-iso-countries": "^4.3.1",
"icalendar": "0.7.1",
"immer": "^9.0.15",
Expand Down Expand Up @@ -696,9 +696,9 @@
"@emotion/jest": "^11.10.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@istanbuljs/schema": "^0.1.2",
"@jest/console": "^26.6.2",
"@jest/reporters": "^26.6.2",
"@jest/types": "^26",
"@jest/console": "^28.1.3",
"@jest/reporters": "^28.1.3",
"@jest/types": "^29",
"@kbn/ambient-storybook-types": "link:bazel-bin/packages/kbn-ambient-storybook-types",
"@kbn/ambient-ui-types": "link:bazel-bin/packages/kbn-ambient-ui-types",
"@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace",
Expand Down Expand Up @@ -781,10 +781,10 @@
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
"@storybook/testing-react": "^1.3.0",
"@storybook/theming": "^6.5.12",
"@testing-library/dom": "^8.12.0",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^13.5.0",
"@types/apidoc": "^0.22.3",
"@types/archiver": "^5.3.1",
Expand Down Expand Up @@ -834,10 +834,9 @@
"@types/history": "^4.7.9",
"@types/hjson": "^2.4.2",
"@types/http-proxy": "^1.17.4",
"@types/http-proxy-agent": "^2.0.2",
"@types/inquirer": "^7.3.1",
"@types/intl-relativeformat": "^2.1.0",
"@types/jest": "^26.0.22",
"@types/jest": "^29.1.2",
"@types/jest-axe": "^3.5.3",
"@types/joi": "^17.2.3",
"@types/jquery": "^3.3.31",
Expand Down Expand Up @@ -1247,7 +1246,7 @@
"@types/tapable": "^1.0.6",
"@types/tar": "^4.0.5",
"@types/tempy": "^0.2.0",
"@types/testing-library__jest-dom": "^5.14.3",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/tinycolor2": "^1.4.1",
"@types/tough-cookie": "^4.0.2",
"@types/type-detect": "^4.0.1",
Expand Down Expand Up @@ -1280,7 +1279,7 @@
"argsplit": "^1.0.5",
"autoprefixer": "^10.4.7",
"axe-core": "^4.0.2",
"babel-jest": "^26.6.3",
"babel-jest": "^28.1.3",
"babel-loader": "^8.2.5",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-istanbul": "^6.1.1",
Expand Down Expand Up @@ -1315,7 +1314,7 @@
"dpdm": "3.5.0",
"ejs": "^3.1.8",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.1",
"enzyme-to-json": "^3.6.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-module-utils": "^2.6.2",
Expand Down Expand Up @@ -1353,21 +1352,20 @@
"html-loader": "^1.3.2",
"http-proxy": "^1.18.1",
"is-path-inside": "^3.0.2",
"jest": "^26.6.3",
"jest": "^28.1.3",
"jest-axe": "^5.0.0",
"jest-canvas-mock": "^2.3.1",
"jest-circus": "^26.6.3",
"jest-cli": "^26.6.3",
"jest-config": "^26",
"jest-diff": "^26.6.2",
"jest-environment-jsdom": "^26.6.2",
"jest-mock": "^26.6.2",
"jest-raw-loader": "^1.0.1",
"jest-runtime": "^26",
"jest-canvas-mock": "^2.4.0",
"jest-cli": "^28.1.3",
"jest-config": "^28.1.3",
"jest-diff": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-matcher-utils": "^28.1.3",
"jest-mock": "^28.1.3",
"jest-runtime": "^28.1.3",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "^26.6.2",
"jest-specific-snapshot": "^4.0.0",
"jest-styled-components": "^7.0.3",
"jest-snapshot": "^28.1.3",
"jest-specific-snapshot": "^5.0.0",
"jest-styled-components": "7.0.3",
"jsdom": "^16.4.0",
"json-schema-typed": "^8.0.1",
"json5": "^1.0.1",
Expand Down Expand Up @@ -1405,7 +1403,6 @@
"postcss-prefix-selector": "^1.16.0",
"postcss-scss": "^4.0.4",
"prettier": "^2.7.1",
"pretty-format": "^27.5.1",
"proxy": "^1.0.2",
"q": "^1.5.1",
"raw-loader": "^3.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('AnalyticsClient', () => {
let logger: MockedLogger;

beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
logger = loggerMock.create();
analyticsClient = new AnalyticsClient({
logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ElasticV3BrowserShipper', () => {
let fetchMock: jest.Mock;

beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });

fetchMock = jest.fn().mockResolvedValue({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('ElasticV3ServerShipper', () => {
const setLastBatchSent = (ms: number) => (shipper['lastBatchSent'] = ms);

beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });

shipper = new ElasticV3ServerShipper(
{ version: '1.2.3', channelName: 'test-channel', debug: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const requiredProps: TableListViewProps = {

describe('TableListView', () => {
beforeAll(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('MetaRewritePolicy', () => {
"error": Object {},
"tags": Array [
"0",
undefined,
,
],
}
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { mocked } from './mocks_internal';

describe('EventLoopDelaysMonitor', () => {
beforeAll(() => {
jest.useFakeTimers('modern');
jest.useFakeTimers();
const mockNow = jest.getRealSystemTime();
jest.setSystemTime(mockNow);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('MetricsService', () => {
let metricsService: MetricsService;

beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });

const configService = configServiceMock.create({
atPath: { interval: moment.duration(testInterval) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('OverlayBannersService', () => {
});

it('dismisses banner after timeout', async () => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
startService('testing banner!');
expect(banners.remove).not.toHaveBeenCalled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const SHAREABLE_HIDDEN_OBJ_TYPE = 'type-c';
const mockCurrentTime = new Date('2021-05-01T10:20:30Z');

beforeAll(() => {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(mockCurrentTime);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { setImmediate } from 'timers/promises';
import { join } from 'path';
import loadJsonFile from 'load-json-file';
import { setImmediate } from 'timers/promises';

import {
clientProviderInstanceMock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Cache } from './cache';

describe('Cache', () => {
beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ describe('ui settings', () => {
describe('caching', () => {
describe('read operations cache user config', () => {
beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterEach(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-apm-synthtrace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TYPES_DEPS = [
"@npm//p-limit",
"@npm//@types/node-fetch",
"@npm//@types/semver",
"@npm//@types/yargs",
]

jsts_transpiler(
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/dev_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { extendedEnvSerializer } from './test_helpers';
import { DevServer, Options } from './dev_server';
import { TestLog } from './log';

jest.useFakeTimers('modern');
jest.useFakeTimers();

class MockProc extends EventEmitter {
public readonly signalsSent: string[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('palette panel', () => {
dataBounds: { min: 0, max: 100 },
};

jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

function changePaletteIn(instance: ReactWrapper, newPaletteName: string) {
Expand Down
10 changes: 5 additions & 5 deletions packages/kbn-datemath/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('dateMath', function () {
let now;

beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
mmnt = moment(anchor);
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('dateMath', function () {
let anchored;

beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('dateMath', function () {
let anchored;

beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
Expand Down Expand Up @@ -205,7 +205,7 @@ describe('dateMath', function () {
let anchored;

beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
Expand Down Expand Up @@ -247,7 +247,7 @@ describe('dateMath', function () {
let anchored;

beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-dev-cli-runner/src/run_with_commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log';
import { ProcRunner } from '@kbn/dev-proc-runner';
jest.mock('./metrics');

import { FlagsReader } from './flags_reader';
import { RunWithCommands } from './run_with_commands';
Expand Down Expand Up @@ -48,7 +49,7 @@ it('extends the context using extendContext()', async () => {
flagsReader: expect.any(FlagsReader),
addCleanupTask: expect.any(Function),
procRunner: expect.any(ProcRunner),
statsMeta: expect.any(Map),
statsMeta: undefined,
extraContext: true,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/src/diff_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import jestDiff from 'jest-diff';
import { diff as jestDiff } from 'jest-diff';
import stripAnsi from 'strip-ansi';
import Chalk from 'chalk';

Expand Down
1 change: 0 additions & 1 deletion packages/kbn-i18n-react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-i18n-react'],
testRunner: 'jasmine2',
};
1 change: 0 additions & 1 deletion packages/kbn-i18n/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-i18n'],
testRunner: 'jasmine2',
};
7 changes: 3 additions & 4 deletions packages/kbn-monaco/src/painless/diagnostics_adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ const getMockWorker = async () => {
} as any;
};

function flushPromises() {
return new Promise((resolve) => setImmediate(resolve));
}
const flushPromises = () =>
new Promise((resolve) => jest.requireActual('timers').setImmediate(resolve));

describe('Painless DiagnosticAdapter', () => {
let diagnosticAdapter: DiagnosticsAdapter;
Expand All @@ -35,7 +34,7 @@ describe('Painless DiagnosticAdapter', () => {
let validation: LangValidation;

beforeAll(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterAll(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/src/common/rxjs_helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { fakeSchedulers } from 'rxjs-marbles/jest';

import { pipeClosure, debounceTimeBuffer, maybeMap, maybe } from './rxjs_helpers';

jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });

describe('pipeClosure()', () => {
it('calls closure on each subscription to setup unique state', async () => {
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('maybeMap()', () => {

describe('debounceTimeBuffer()', () => {
beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const bundleCacheEvent$ = Rx.from(BUNDLES).pipe(
);

beforeEach(async () => {
jest.useFakeTimers();
jest.useFakeTimers({ legacyFakeTimers: true });
});

afterEach(async () => {
Expand Down
Loading