Understanding deno test Behavior with Interdependent Modules
I'm seeking clarification on how Deno's test runner (deno test) manages interdependent modules. Consider the following module dependencies:
Module A depends on Module B
Module B depends on Module C
If I execute deno test for Module A, will the test runner automatically execute the test cases for Modules B and C, given their dependency chain?
If this automatic execution isn't currently supported, are there any plans to implement such a feature in future releases?
If this functionality is not available and there are no existing plans to include it, would it be appropriate for me to submit a feature request or open an issue to discuss its potential implementation?
Thank you for your insights.
20 Replies
deno test
executes all tests in the files it discovers
So it should just work right nowok but dag manner test cases execution possible right now?
I don't really understand what you mean here. If you have
a_test.ts
that pulls b_test.ts
that pulls c_test.ts
then Deno will discover all 3 files and run tests from ityes and in dag manner
Do you have a concrete example or a repo that you can share?
ok i will share. thanks for support
we want to run test cases in this manner, no if i run a_test.ts then it should automatically detect what test cases needs to be executed first.
Then no, this is not supported
any work in progress or issue/pr to track work if no then should i create issue?
i think cli is already using deno_graph and that features can be extended to deno test also...so
what you suggest?
Feel free to open an issue, there's none atm
But please include a better example because I'm still not sure if I understand the request
Is module A, B and C in a workspace or individual?
it's in workspace, then it is possible? or any other way?
When you do
deno test
it will execute all the tests in the workspace. If you specify for it to only do module As tests then it will only do module As test. It won't go down As dependencies looking for tests available for its dependencies.
How you want it to work isn't possible as there is no connection between the code's dependencies to the code's dependency's tests.Okay got it, but is there any way to achieve this or needs to be implemented as a core feature in the deno cli test?
It's not possible to do it the way you want it. You either execute all the tests or specify exactly which tests.
it can be automated if the deno project is fully in workspace manner and by using deno_graph for this and then all test cases can be executed automatically in the required dag manner?
After implementing such a feature only i am asking, is it possible right?
What does dag mean
Directly acyclic graph
@Doctor 🤖 this one
It's not currently available to test it in the manner you want and it's unlikely that it will become available
ok thanks for clarity