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

Chore: update sinon calls to deprecated API. #8310

Merged
merged 1 commit into from Mar 23, 2017

Conversation

alberto
Copy link
Member

@alberto alberto commented Mar 22, 2017

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:

What changes did you make? (Give an overview)
sinon started complaining noisily about using a deprecated call:

sinon.stub(obj, 'meth', fn) is deprecated and will be removed from the public API in a future version of sinon.
 Use stub(obj, 'meth').callsFake(fn).
 Codemod available at https://github.com/hurrymaplelad/sinon-codemod

This PR removes the warning.
Is there anything you'd like reviewers to focus on?
No.

@alberto alberto added the chore This change is not user-facing label Mar 22, 2017
@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@alberto, thanks for your PR! By analyzing the history of the files in this pull request, we identified @IanVS, @not-an-aardvark and @mysticatea to be potential reviewers.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Just one small change, otherwise LGTM.

@@ -74,7 +74,7 @@ describe("pathUtil", () => {
const filePath = "file/path.js";
const basePath = "/absolute/file";

sinon.stub(process, "cwd", () => "/absolute/");
sinon.stub(process, "cwd").callsFake(() => "/absolute/");
Copy link
Member

Choose a reason for hiding this comment

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

It'd be more idiomatic to use sinon.stub(process, "CWD").returns("/absolute/") here.

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Sorry for being slow to follow up.

@platinumazure platinumazure merged commit 614b62e into master Mar 23, 2017
@alberto alberto deleted the update-sinon-calls branch March 29, 2017 09:00
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants