Separate tests into their own directory
Closed this issue · 0 comments
twpayne commented
Currently tests are in src/index.spec.ts
, which is the same directory as the source code. The TypeScript compiler also currently generates several files from this in the dist/
directory, which are unwanted:
dist/index.spec.js
dist/index.spec.js.map
dist/types/index.spec.d.ts
dist/types/index.spec.d.ts.map
It would be nice to move the tests into their own subdirectory, say tests/
, and not have these test-related files generated in dist/
.
Note that the tests also run both the TypeScript tests and the JavaScript tests generated from the TypeScript tests:
$ npm test
> @twpayne/xcscore@1.0.2 test /Users/twp/src/github.com/twpayne/xcscore-js
> jest
PASS src/index.spec.ts
PASS dist/index.spec.js
Test Suites: 2 passed, 2 total
Tests: 70 passed, 70 total
Snapshots: 0 total
Time: 2.077s
Ran all test suites.
Note that both src/index.spec.ts
and dist/index.spec.js
are both run. It would be nice if separating the tests also meant that only src/index.spec.ts
was run.