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

Conversation

njd5475
Copy link
Contributor

@njd5475 njd5475 commented Feb 26, 2019

Jest mocking offers compatible feature set to sinon. Even though some of the sinon conventions might be preferred, it is in our best interest to use jest as there is really no need for mixing tests with jest mocking and sinon.

@njd5475 njd5475 requested review from spalger and mikecote February 26, 2019 16:26
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Just have a few nits but LGTM once CI passes 👍 great work!

Promise.resolve({
items: [],
})
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: There's a shorter alternative you can do throughout, jest.fn().mockResolvedValue({ items: [] })

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@njd5475 njd5475 merged commit 827e652 into elastic:master Feb 27, 2019
njd5475 added a commit to njd5475/kibana that referenced this pull request Feb 27, 2019
* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.
njd5475 added a commit to njd5475/kibana that referenced this pull request Feb 27, 2019
* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.
njd5475 added a commit that referenced this pull request Feb 28, 2019
* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.
njd5475 added a commit that referenced this pull request Feb 28, 2019
* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.
mshustov added a commit to mshustov/kibana that referenced this pull request Feb 28, 2019
* udpate jest, jest-cli, @types/jest to v24

* fix type error in kibana-i18n package

* return serivce explicitly to fix typings

* add explicit never

* suppress typings errors

* update jest versions in x-pack

* make tests in x-pack more robust and fix incompatibility

* suppress CallCluster mock typings

Mock interface doesn't match CallCluster. Requires
additional work

* x-pack. resolve other typing conflicts

* remove unused types/jest

* fix snapshots

* restore mocks after jest.spyOn

* remove outdated definitions for jest

* cleanup x-pack package.json and update @types/jest

* fix tests merged from master

* updated yarn.lock and log errors for scripts/type_check

* This commit fixes error in TS, which failed on parsing the file.

* suppress type errors from master

* jest-cli is devDep

Removes sinon from saved objects unit tests. (elastic#32045) (elastic#32151)

* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.

temp
mshustov added a commit that referenced this pull request Feb 28, 2019
* udpate jest, jest-cli, @types/jest to v24

* fix type error in kibana-i18n package

* return serivce explicitly to fix typings

* add explicit never

* suppress typings errors

* update jest versions in x-pack

* make tests in x-pack more robust and fix incompatibility

* suppress CallCluster mock typings

Mock interface doesn't match CallCluster. Requires
additional work

* x-pack. resolve other typing conflicts

* remove unused types/jest

* fix snapshots

* restore mocks after jest.spyOn

* remove outdated definitions for jest

* cleanup x-pack package.json and update @types/jest

* fix tests merged from master

* updated yarn.lock and log errors for scripts/type_check

* This commit fixes error in TS, which failed on parsing the file.

* suppress type errors from master

* jest-cli is devDep

Removes sinon from saved objects unit tests. (#32045) (#32151)

* Removes sinon from saved objects unit tests.

* Uses mockResolvedValue for return values as promises.

temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants