Skip to content

Commit 59903df

Browse files
Merge branch 'master' of github.com:elastic/kibana into a11y-bug-fixes
2 parents 3e2dd6d + 5dca937 commit 59903df

13 files changed

Lines changed: 50 additions & 51 deletions

File tree

x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/__tests__/ErrorCount.test.tsx renamed to x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/ErrorCount.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import { fireEvent, render } from '@testing-library/react';
88
import React from 'react';
9-
import { expectTextsInDocument } from '../../../../../utils/testHelpers';
10-
import { ErrorCount } from '../ErrorCount';
9+
import { expectTextsInDocument } from '../../../../utils/testHelpers';
10+
import { ErrorCount } from './ErrorCount';
1111

1212
describe('ErrorCount', () => {
1313
it('shows singular error message', () => {

x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md renamed to x-pack/plugins/reporting/server/browsers/extract/__fixtures__/file.md

File renamed without changes.

x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md.zip renamed to x-pack/plugins/reporting/server/browsers/extract/__fixtures__/file.md.zip

File renamed without changes.

x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js renamed to x-pack/plugins/reporting/server/browsers/extract/extract.test.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
import fs from 'fs';
88
import crypto from 'crypto';
9-
import expect from '@kbn/expect';
109
import { resolve } from 'path';
1110

12-
import { extract } from '../extract';
13-
import { ExtractError } from '../extract_error';
11+
import { extract } from './extract';
12+
import { ExtractError } from './extract_error';
1413
import { promisify } from 'util';
1514

1615
const FIXTURES_FOLDER = resolve(__dirname, '__fixtures__');
@@ -71,18 +70,18 @@ describe('extract', () => {
7170
thrownException = e;
7271
}
7372

74-
expect(thrownException).to.be.an(ExtractError);
73+
expect(thrownException).toBeInstanceOf(ExtractError);
7574
});
7675

7776
it('successfully extracts a valid zip file to the given target', async () => {
7877
await extract(SRC_FILE_COMPRESSED_ZIP, EXTRACT_TARGET_FOLDER);
7978

8079
const stats = fs.statSync(EXTRACT_TARGET_FILE);
81-
expect(stats).to.be.an(Object);
80+
expect(stats).toBeInstanceOf(fs.Stats);
8281

8382
const srcFileHash = await fileHash(SRC_FILE_UNCOMPRESSED);
8483
const targetFileHash = await fileHash(EXTRACT_TARGET_FILE);
85-
expect(targetFileHash).to.eql(srcFileHash);
84+
expect(targetFileHash).toEqual(srcFileHash);
8685
});
8786

8887
if (isWindows) {
@@ -100,8 +99,8 @@ describe('extract', () => {
10099
thrownException = e;
101100
}
102101

103-
expect(thrownException).to.be.an(ExtractError);
104-
expect(thrownException.cause.code).to.eql('EACCES');
102+
expect(thrownException).toBeInstanceOf(ExtractError);
103+
expect(thrownException.cause.code).toEqual('EACCES');
105104
});
106105
}
107106
});

x-pack/plugins/reporting/server/lib/create_worker.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { createWorkerFactory } from './create_worker';
1616
// @ts-ignore
1717
import { Esqueue } from './esqueue';
1818
// @ts-ignore
19-
import { ClientMock } from './esqueue/__tests__/fixtures/legacy_elasticsearch';
19+
import { ClientMock } from './esqueue/__fixtures__/legacy_elasticsearch';
2020
import { ExportTypesRegistry } from './export_types_registry';
2121

2222
const logger = createMockLevelLogger();

x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js renamed to x-pack/plugins/reporting/server/lib/esqueue/__fixtures__/job.js

File renamed without changes.

x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/legacy_elasticsearch.js renamed to x-pack/plugins/reporting/server/lib/esqueue/__fixtures__/legacy_elasticsearch.js

File renamed without changes.

x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js renamed to x-pack/plugins/reporting/server/lib/esqueue/__fixtures__/queue.js

File renamed without changes.

x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js renamed to x-pack/plugins/reporting/server/lib/esqueue/__fixtures__/worker.js

File renamed without changes.

x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js renamed to x-pack/plugins/reporting/server/lib/esqueue/helpers/errors.test.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,53 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import expect from '@kbn/expect';
8-
import { WorkerTimeoutError, UnspecifiedWorkerError } from '../../helpers/errors';
7+
import { WorkerTimeoutError, UnspecifiedWorkerError } from './errors';
98

109
describe('custom errors', function () {
1110
describe('WorkerTimeoutError', function () {
1211
it('should be function', () => {
13-
expect(WorkerTimeoutError).to.be.a('function');
12+
expect(typeof WorkerTimeoutError).toBe('function');
1413
});
1514

1615
it('should have a name', function () {
1716
const err = new WorkerTimeoutError('timeout error');
18-
expect(err).to.have.property('name', 'WorkerTimeoutError');
17+
expect(err).toHaveProperty('name', 'WorkerTimeoutError');
1918
});
2019

2120
it('should take a jobId property', function () {
2221
const err = new WorkerTimeoutError('timeout error', { jobId: 'il7hl34rqlo8ro' });
23-
expect(err).to.have.property('jobId', 'il7hl34rqlo8ro');
22+
expect(err).toHaveProperty('jobId', 'il7hl34rqlo8ro');
2423
});
2524

2625
it('should take a timeout property', function () {
2726
const err = new WorkerTimeoutError('timeout error', { timeout: 15000 });
28-
expect(err).to.have.property('timeout', 15000);
27+
expect(err).toHaveProperty('timeout', 15000);
2928
});
3029

3130
it('should be stringifyable', function () {
3231
const err = new WorkerTimeoutError('timeout error');
33-
expect(`${err}`).to.equal('WorkerTimeoutError: timeout error');
32+
expect(`${err}`).toEqual('WorkerTimeoutError: timeout error');
3433
});
3534
});
3635

3736
describe('UnspecifiedWorkerError', function () {
3837
it('should be function', () => {
39-
expect(UnspecifiedWorkerError).to.be.a('function');
38+
expect(typeof UnspecifiedWorkerError).toBe('function');
4039
});
4140

4241
it('should have a name', function () {
4342
const err = new UnspecifiedWorkerError('unspecified error');
44-
expect(err).to.have.property('name', 'UnspecifiedWorkerError');
43+
expect(err).toHaveProperty('name', 'UnspecifiedWorkerError');
4544
});
4645

4746
it('should take a jobId property', function () {
4847
const err = new UnspecifiedWorkerError('unspecified error', { jobId: 'il7hl34rqlo8ro' });
49-
expect(err).to.have.property('jobId', 'il7hl34rqlo8ro');
48+
expect(err).toHaveProperty('jobId', 'il7hl34rqlo8ro');
5049
});
5150

5251
it('should be stringifyable', function () {
5352
const err = new UnspecifiedWorkerError('unspecified error');
54-
expect(`${err}`).to.equal('UnspecifiedWorkerError: unspecified error');
53+
expect(`${err}`).toEqual('UnspecifiedWorkerError: unspecified error');
5554
});
5655
});
5756
});

0 commit comments

Comments
 (0)