Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Remove chai from end2end tests #2139

Closed
bonomat opened this issue Mar 3, 2020 · 3 comments · Fixed by #2562 or #2565
Closed

Remove chai from end2end tests #2139

bonomat opened this issue Mar 3, 2020 · 3 comments · Fixed by #2562 or #2565

Comments

@bonomat
Copy link
Member

bonomat commented Mar 3, 2020

This is a follow-up ticket from #2106

Problem

After moving to jest we should only use jest matchers and no chai matchers

Goal

Don't have any chai matchers and remove chai from package.json

Recommendation

Remove

"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-bignumber": "^3.0.0",
"chai-each": "^0.0.1",
"chai-http": "^4.2.0",
"chai-json-schema": "^1.5.0",
"chai-string": "^1.5.0",
"chai-subset": "^1.6.0",
(including the types a few lines up) and fix the e2e tests.

Note: straightforward replace, don't refactor everything.

@D4nte
Copy link
Contributor

D4nte commented Mar 30, 2020

Note: json schema validation with jest looks hard.

I tried using https://github.com/epoberezkin/ajv/releases/tag/5.0.0

But our schema is draft-04 and the steps in the migration section of the release above threw an error.

@D4nte D4nte removed their assignment Mar 30, 2020
@bonomat bonomat assigned bonomat and unassigned bonomat Apr 1, 2020
@D4nte D4nte self-assigned this Apr 29, 2020
@D4nte D4nte added this to the Sprint 33 ⏫🛢 milestone Apr 29, 2020
@D4nte
Copy link
Contributor

D4nte commented Apr 29, 2020

@thomaseizinger is it fine if we update our json schema to draft-06?

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Apr 30, 2020

@thomaseizinger is it fine if we update our json schema to draft-06?

Yes, no objections.

@D4nte D4nte linked a pull request May 1, 2020 that will close this issue
bors bot added a commit that referenced this issue May 4, 2020
2558: Remove chai-bignumber r=mergify[bot] a=D4nte

- Remove `chai-bignumber` dependency.
- Removed chai usage from few files
- Replace use of `BigNumber` with `bigint`

~Needs DefinitelyTyped/DefinitelyTyped#44368 to be merged and released~.

Edit: using `@ts-ignore` for now.

Helps with #2139.

Co-authored-by: Franck Royer <franck@coblox.tech>
@D4nte D4nte mentioned this issue May 4, 2020
bors bot added a commit that referenced this issue May 4, 2020
2562: Remove chai-http r=D4nte a=D4nte

- Migrate more chai expect to jest expect
- Remove chai-http and chai-as-promised deps

Helps with #2139

Co-authored-by: Franck Royer <franck@coblox.tech>
@bors bors bot closed this as completed in #2562 May 4, 2020
bors bot added a commit that referenced this issue May 4, 2020
2565: Remove chai schema r=D4nte a=D4nte

Resolves #2139

Co-authored-by: Franck Royer <franck@coblox.tech>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants