This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
Insights from dogfooding #1
wojpawlik
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
deno.ns/tools/run_deno_unit_tests.ts
->deno.ns/tools/deno_test.js
->@fromdeno/cache/node/dtest.mjs
->fdt
deno.ns
doesn't use URL imports, soNODE_OPTIONS=--experimental-loader=ts-node/esm fdt
worked great for testing TypeScript code, without explicit build step.fdt
uses dynamic import to load test files in order to support ESM, so modifyingrequire.extensions
via--require=ts-node/register
or--require=sucrase/register/ts
isn't supported.require
d from CJS tho.deno.ns
first "test file" contains no tests. Instead, it sets globals required by subsequent tests and changes working directory. I expect this to be common pattern until I manage to isolate test files form each other in a major release.@fromdeno/cache
does use URL imports, so it usesdeno2node
to build the test files (intoout/test/
) alongside source (intoout/src/
). Tests on Node.js are ran after build, in preposterous"postprepare"
script :)src/
andtest/
simultaneously, enable"composite"
. Otherwise, TypeScript may buildsrc/
intoout/
instead ofout/src/
when you don't build tests, breaking your package.Beta Was this translation helpful? Give feedback.
All reactions