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

fix: Upgraded Chai, Sinon and other test dependencies #938

Merged
merged 7 commits into from
Jul 10, 2020

Conversation

hiranya911
Copy link
Contributor

@hiranya911 hiranya911 commented Jul 9, 2020

We are using several heavily outdated test dependencies, and this PR upgrades them to the latest versions:

  • Chai 3.5 --> 4.2
  • Sinon 4.5 --> 9.0
  • Sinon-Chai 2.14 --> 3.0
  • Chai-as-promised 6.0 --> 7.0

The biggest change stems from the Chai upgrade, where the latest versions of Chai do not allow deep.equals assertions on Error types. See chaijs/chai#1009. Therefore I had to use deep.include in all the places where we directly compare Error objects.

The latest versions of Sinon also have better TS support which caused several TS compilation errors in tests. I've fixed those instances too.

test/unit/auth/auth.spec.ts Show resolved Hide resolved
test/unit/auth/user-import-builder.spec.ts Outdated Show resolved Hide resolved
test/unit/remote-config/remote-config-api-client.spec.ts Outdated Show resolved Hide resolved
@nbegley nbegley removed their assignment Jul 9, 2020
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thanks Hiranya!
LGTM! Left couple comments

test/unit/auth/auth-api-request.spec.ts Outdated Show resolved Hide resolved
test/unit/remote-config/remote-config-api-client.spec.ts Outdated Show resolved Hide resolved
@lahirumaramba lahirumaramba removed their assignment Jul 10, 2020
@bojeil-google bojeil-google removed their assignment Jul 10, 2020
Copy link
Contributor

@ifielker ifielker left a comment

Choose a reason for hiding this comment

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

LGTM

@hiranya911 hiranya911 assigned hiranya911 and unassigned ifielker Jul 10, 2020
@hiranya911 hiranya911 merged commit 6cce54f into master Jul 10, 2020
@hiranya911 hiranya911 deleted the hkj-chai-upgrade branch July 10, 2020 19:06
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.

None yet

5 participants