Skip to content

Typecheck tests before running them #727

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

Merged
merged 1 commit into from
May 3, 2021
Merged

Conversation

glasser
Copy link
Member

@glasser glasser commented May 3, 2021

Something like this was intended to be part of #453. Because we have
diagnostics: false in jest.config.base.js, typechecking failures in
ts-jest don't actually stop the tests from running successfully; this
change makes us typecheck the tests before we run them. (If you really
want to run tests that don't typecheck you can run npx jest directly.)

As part of this, fix a typechecking failure caused by the upgrade in
PR #716 and run npm dedup to fix another typechecking failure. The npm dedup
itself causes a snapshot to need to be updated (as the snapshot was created by
some code that was still running a nested apollo-server 2.23).

We may want to consider finding a way to be comfortable removing
diagnostics: false instead as in #661, but we'll need to fix #662 before
we can do that.

@glasser glasser requested a review from martijnwalraven May 3, 2021 06:57
Something like this was intended to be part of #453. Because we have
`diagnostics: false` in jest.config.base.js, typechecking failures in
ts-jest don't actually stop the tests from running successfully; this
change makes us typecheck the tests before we run them. (If you really
want to run tests that don't typecheck you can run `npx jest` directly.)

As part of this, fix a typechecking failure caused by the upgrade in
PR #716 and run `npm dedup` to fix another one.

We may want to consider finding a way to be comfortable removing
`diagnostics: false` instead.
@glasser glasser force-pushed the glasser/typecheck-tests branch from 1c34e04 to 5acd50d Compare May 3, 2021 07:18
@glasser glasser enabled auto-merge (squash) May 3, 2021 07:23
Copy link
Contributor

@martijnwalraven martijnwalraven left a comment

Choose a reason for hiding this comment

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

We may want to relax this once we can get diagnostics: true working reliably, but this at least makes sure tests fail when there are typing errors.

@glasser glasser merged commit e7f2d51 into main May 3, 2021
@glasser glasser deleted the glasser/typecheck-tests branch May 3, 2021 07:38
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.

GraphQLSchema produced by composeServices and by buildComposedSchema have different federation extensions
2 participants