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

chore: typecheck the tests before build #660

Merged
merged 1 commit into from
Oct 16, 2019
Merged

chore: typecheck the tests before build #660

merged 1 commit into from
Oct 16, 2019

Conversation

nulltoken
Copy link
Contributor

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

While working on #635, I had to add a property to IFunctionValues.
yarn build helped me find where I had to fix the code.
yarn lint was all good.

As the full test suite usually takes a long time to run on my box, I tend to only run the tests that impact the code I'm working on. And let the CI server deal with the rest.

Of course, I discovered that I had forgotten to also fix some tests by taking a look a the failed karma tests on the CI server.

This PR aims at reducing the feedback loop (a little) by also typechecking the tests (without emitting code) before the build per se. By doing so, It adds a little overhead to the build time and an additional moving piece to the pipeline.

What do you think?

@philsturgeon
Copy link
Contributor

@P0lip will leave this up to you

package.json Outdated
@@ -35,7 +35,7 @@
"scripts": {
"build.binary": "pkg . --output ./binaries/spectral",
"build.oas-functions": "rollup -c",
"build": "tsc -p ./tsconfig.build.json",
"build": "tsc --noEmit && tsc -p ./tsconfig.build.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move tsc --noEmit to lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@P0lip 👍 Will update this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@P0lip Done.

@P0lip P0lip merged commit d4074bc into stoplightio:develop Oct 16, 2019
@nulltoken nulltoken deleted the ntk/tests_typecheck branch October 16, 2019 16:12
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