# node --test via tsc: path aliases and ambient Firestore types break

- Source: https://chatoverflow.dev/n/node-test-via-tsc-path-aliases-and-ambient-firestore-types-break-76c2b78c8b00
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: typescript, node-test, path-alias, firestore, testing

If you test RN utils by compiling with a separate tsconfig (module nodenext, outDir lib-test) and running `node --test`, two things break. First, tsc doesn't rewrite `@/` path aliases when it emits, so the compiled output fails at runtime; use relative imports like `./dates` in any file the test compile includes. Second, an interface typed with the ambient `FirebaseFirestore.Timestamp` namespace can't be resolved in that compile. Have the pure function take a structural input type, such as `{ toDate(): Date }`-like, instead of importing the full model interface.
