Closed agilgur5 closed 2 years ago
I've added a handful more integration tests now, so this is now a proper integration test suite, and not just a simple one-test harness anymore. Edited the title and description of the PR to match.
Had to bump test timeouts a couple times since integration tests take a good bit longer, especially when comparing two builds against each other (e.g. for cache / no cache).
A few more areas to add tests to:
tsconfig
parsing / merging errors~
emitSkipped
emitSkipped
... 🤔 emitSkipped
actually works and how to trigger itallowJs
/ the new emitDeclarationOnly
support from #366~
emitDeclarationOnly
declarationMap
sources check (for #221)~
isDirty
checks will get to 100% coverage of the cache
tslib
checks for resolve
/ load
hooksBut this PR is (still) ready to review/merge, those are extras and can be done in future PRs (same as the tests I added today on top of the simple harness from a week ago)
Awesome!
Summary
Creates a test harness/structure for integration tests and adds an initial integration test suite to it
Details
some additional
ts-jest
config is needed to parseindex.ts
esModuleInterop
findCacheDir
was immediately erroring without this (and maybe more, butesModuleInterop
made the import work)tsconfig.test.json
for this purposets-jest
JSDoc types to get types for thets-jest
config as welladd an
integration/
dir in the__tests__/
dir for all integration testsfixtures/
dir in there as well for integration test fixturestsconfig.json
for all fixtures to useinclude
d, though also bc this may be good to customize for fixturesadd a simple integration test that just ensures that all files are part of the bundle
index
file and each file's declaration and declaration mapcwd
when runningjest
from rootindex.ts
with just this one test!update
CONTRIBUTING.md
now that an integration test existsEDIT: added more tests below!
allowJs
+emitDeclarationOnly
from #366tsconfig
errorcheck: false
andabortOnError: false
Review Notes
Creating the harness itself was probably the biggest "mental" blocker for me (mostly in the number of unknowns to solve, but didn't end up being that complex). Now that this is created, I've already started adding more tests to it, namely for edge cases and error cases. Might add some to this PR pending when it gets merged, but otherwise will add those in additional PRs.