Issues when using snapshot tests with DNT: tests and builds
- Dominant language
- Rust
- Stars
- 1.3k
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
During type checking:
```
[dnt] Building project...
[dnt] Type checking...
src/deps/deno.land/std@0.168.0/testing/snapshot.ts:420:18 - error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
420 globalThis.addEventListener("unload", this.#teardown);
~~~~~~~~~~~~~~~~
error: Uncaught Error: Had 1 diagnostics.
throw new Error(`Had ${diagnostics.length} diagnostics.`);
^
at build (https://deno.land/x/dnt@0.33.0/mod.ts:320:15)
at async file:///home/orta/dev/puzmo/redwood-codegen-api-types/scripts/buildNPM.ts:7:1
```
During testing:
```
FAILURES
uses a rn to promise when we see an async tag
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/orta/dev/puzmo/redwood-codegen-api-types/npm/esm/tests/__snapshots__/preferPromiseFnWhenKnown.test.js.snap' imported from /home/orta/dev/puzmo/redwood-codegen-api-types/npm/esm/deps/deno.land/std@0.168.0/testing/snapshot.js
```
I bet for testing `.snap` files need to be migrated with other files? For build - unsure. Right now, I just made it skip both, though I may just drop the snapshot, it's only 1 and I only like using [inline snapshots](http://orta.io/notes/tests/inline-snapshots) anyway
Contributor guide
Assessment
This issue has not been assessed yet.