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 supertest app.test.ts example #1282

Merged
merged 5 commits into from
Oct 4, 2023
Merged

Conversation

lukeymyuan
Copy link
Contributor

@lukeymyuan lukeymyuan commented Oct 3, 2023

Why

The below unit tests do not fail when endpoint returns 404
We either use expect function or throw when check fails https://github.com/ladjs/supertest#expectfunctionres-

- await agent.get('/').expect(({ status }) => status !== 404);
+ await agent.get('/').expect(({ status }) => expect(status).not.toBe(404));

What

Modify unit test
Add usage message when argument is not received

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2023

🦋 Changeset detected

Latest commit: 865be0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukeymyuan lukeymyuan marked this pull request as ready for review October 4, 2023 05:09
@lukeymyuan lukeymyuan requested review from a team as code owners October 4, 2023 05:09
@lukeymyuan lukeymyuan requested a review from 72636c October 4, 2023 05:41
@lukeymyuan lukeymyuan changed the title fix smoke test unit test fix supertest app.test.ts example Oct 4, 2023
@lukeymyuan lukeymyuan requested a review from 72636c October 4, 2023 06:10
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

🙇 thanks a bunch!

@72636c 72636c enabled auto-merge (squash) October 4, 2023 22:49
@72636c 72636c merged commit 26497b9 into seek-oss:master Oct 4, 2023
10 checks passed
@seek-oss-ci seek-oss-ci mentioned this pull request Oct 4, 2023
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

2 participants