chore(test): start fixing test types #3680
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
At the moment, the
test
script runs the specs using mocha and usests-node/register
to transpile the TypeScript. However, the configuration does not enable type checking and there are many, many errors.This PR adds some temporary changes to the infrastructure to facilitate the incremental fixing of these type errors. Specifically it:
spec/tsconfig.check.json
file.include
in said file so that files can be incrementally checked and fixed.script
namedtest_check
in thepackage.json
to run a no-emittsc
build that usesspec/tsconfig.check.json
.npm run test_check
in the.travis.yml
configuration file so that the CI build runs it.With these changes it's possible to incrementally fix specific spec files - by adding them to the
includes
property in thespec/tsconfig.check.json
file. This PR includes fixes for several files. However, fixes are still outstanding for all of the spec files in:spec/observables
spec/operators
spec/schedulers
spec/subjects
The intention is for PRs to include individual commits for specific files. For example, add
./operators/buffer-spec.ts
to theinclude
property, fix any type errors, then include those fixes in a commit.When all
-spec.ts
files pass, the temporary scripts can be removed from thepackage.json
and the.travis.yml
files and thespec/tsconfig.check.json
file can be deleted.At that stage, the
TS_NODE_TYPE_CHECK
environment variable can be added to thetest
script so thatts-node
will throw an error if a TypeScript error is introduced into the tests.Related issue (if exists): #3411