RFC: Inline tests and nested test modules via module blocks #11751
caspervonb
started this conversation in
Ideas
Replies: 2 comments
-
This is an interesting idea. There are two major disadvantages to this that I believe are dealbreakers though:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Neat little thing is that you can actually generate modules by creating blob url objects.
Yeah it's just inlining a module. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Note: early very rough draft, most properties are missing from the interface.
This would be one or two years into the future and most likely an additive feature to declarative tests (#11235).
Our unit of testing are modules, the test runner runs each module in isolation and already offers a shared scope via the top level module scope.
We have before and after hooks via the module's evaluation phase for top level await and we also have lifecycle events in the form of
load
andunload
.People are asking for a way to group tests into smaller scopes with its own lifecycle hooks, the answer to that today is to for you to create another module but having to create a module for each logical local block isn't that great.
The module blocks proposal (which is currently in stage 2) makes this declarative and we can extend the test harness to embrace module blocks.
Interface
Example
Life cycle visualised:
Beta Was this translation helpful? Give feedback.
All reactions