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

enable type checking for tests and mocks #325

Merged
merged 4 commits into from
Apr 13, 2021
Merged

Conversation

dsokal
Copy link
Contributor

@dsokal dsokal commented Apr 12, 2021

Checklist

Why

We don't run type checks on files in __mocks__ and __tests__ directories.

How

  • 569a9d2
    • This commit introduces separate tsconfig files for development (tsconfig.json) and for release/build (tsconfig.build.json).
    • The difference between them is that the latter excludes files from __mocks__ and __tests__ .
  • 872f1d8 fixes type errors in tests.
  • 8377d3c adds the typecheck script to the root package.json. Thanks to that script we can type check tests (and regular code as well) on CI.

Test Plan

Tests pass on CI.

@dsokal dsokal force-pushed the @dsokal/tsconfig-tweaks branch from ef2b35f to 91f03f0 Compare April 12, 2021 16:12
@dsokal dsokal changed the title @dsokal/tsconfig tweaks enable type checking for tests and mocks Apr 12, 2021
@dsokal dsokal force-pushed the @dsokal/tsconfig-tweaks branch from 91f03f0 to 8377d3c Compare April 12, 2021 16:39
@github-actions
Copy link

github-actions bot commented Apr 12, 2021

Size Change: +1.46 kB (0%)

Total Size: 32.9 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 32.9 MB +1.46 kB (0%)

compressed-size-action

@dsokal dsokal marked this pull request as ready for review April 12, 2021 16:43
@dsokal dsokal requested review from wkozyra95, fson and quinlanj April 12, 2021 16:43
Copy link
Member

@quinlanj quinlanj left a comment

Choose a reason for hiding this comment

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

💯

@@ -163,8 +163,9 @@
"scripts": {
"postpack": "rm -f oclif.manifest.json",
"prepack": "rm -rf build && yarn build && yarn oclif-dev manifest && yarn oclif-dev readme",
"build": "tsc",
"watch": "tsc --watch",
"build": "tsc -p tsconfig.build.json",
Copy link
Member

Choose a reason for hiding this comment

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

-p flag doesn't readily show up on tsc --help so project flag would be clearer

Suggested change
"build": "tsc -p tsconfig.build.json",
"build": "tsc --project tsconfig.build.json",

@dsokal dsokal merged commit fbaba77 into main Apr 13, 2021
@dsokal dsokal deleted the @dsokal/tsconfig-tweaks branch April 13, 2021 09:49
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.

3 participants