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

Removes sinon from saved objects unit tests. #32045

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import _ from 'lodash';
import sinon from 'sinon';
import { RawSavedObjectDoc } from '../../serialization';
import { DocumentMigrator } from './document_migrator';

Expand All @@ -28,7 +27,7 @@ describe('DocumentMigrator', () => {
kibanaVersion: '25.2.3',
migrations: {},
validateDoc: _.noop,
log: sinon.spy(),
log: jest.fn(),
};
}

Expand Down Expand Up @@ -475,7 +474,7 @@ describe('DocumentMigrator', () => {
});

it('logs the document and transform that failed', () => {
const log = sinon.spy();
const log = jest.fn();
const migrator = new DocumentMigrator({
...testOpts(),
migrations: {
Expand All @@ -498,7 +497,7 @@ describe('DocumentMigrator', () => {
expect('Did not throw').toEqual('But it should have!');
} catch (error) {
expect(error.message).toMatch(/Dang diggity!/);
const warning = log.args.filter(([[level]]) => level === 'warning')[0][1];
const warning = log.mock.calls.filter(([[level]]) => level === 'warning')[0][1];
expect(warning).toContain(JSON.stringify(failedDoc));
expect(warning).toContain('dog:1.2.3');
}
Expand Down
Loading