rollup-plugin-typescript2
rollup-plugin-typescript2 copied to clipboard
test: add `parse-tsconfig` spec
trafficstars
Summary
Adds unit tests for a few scenarios of parse-tsconfig.ts
- Follow-up to #321 and https://github.com/ezolenko/rollup-plugin-typescript2/pull/371#issuecomment-1174339120
Details
-
test passing
tsconfig, buggytsconfig, non-existenttsconfig, and not atsconfig -
clean: "failed to read" error will never happen as we already checked for existence of the file earlier
- so remove the
undefinedcheck and instead use a non-null assertion (plus a comment explaining it)
- so remove the
-
refactor: move the integration test for
tsconfigerror into this unit test instead- faster / more efficient / more precise
-
refactor: split out a
makeOptionsfunc that creates default plugin options to use in tests- similar to
makeStubbedContext
- similar to
Future Work
- Could also test that merging
tsconfigs works correctly, not just that it doesn't throw- Would be particularly useful for when #86 is implemented as that would no longer be a straight
lodashdeep merge anymore
- Would be particularly useful for when #86 is implemented as that would no longer be a straight