dnt icon indicating copy to clipboard operation
dnt copied to clipboard

Project with dedicated `tests/` vs. `src/` directories errors with prefix exception

Open filmaj opened this issue 2 years ago • 2 comments

TL;DR A CI execution for our deno project which uses dnt to compile a version of the project into a node-friendly format failed after I introduced a new tests/ directory at the top level of our project, while the entrypoint for the project is under src/mod.ts. The error is:

[dnt] Transforming...
error: Uncaught (in promise) "Error stripping prefix of /Users/fmaj/src/deno-slack-sdk/tests/integration/functions/function_handler_test.ts with base /Users/fmaj/src/deno-slack-sdk/src"

Many Thanks

Before diving in, many thanks for the excellent project! Much appreciated ❤️

Longer Version

Our project's entry point has always been src/mod.ts, and tests were initially sprinkled around under src/ in various places and used the deno convention of _test.ts file name suffixes to differentiate between source vs. test files.

Recently we worked on a refactor of the project and we decided to keep more unit-test-y files under src/ as before, while we introduced more integration-test-y files in a new directory in the root of the project under tests/ - outside of the src/ directory.

The full code / build options for our dnt use can be found here.

I can work around this issue by setting test: false on the dnt build options, FYI, but it seems like housing tests outside of any directory referenced in the entry point is not supported by dnt?

filmaj avatar Jan 31 '23 17:01 filmaj

I ran into the same issue.

bdarcus avatar May 09 '23 21:05 bdarcus