You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a concern as far as Mithril or ospec itself are concerned, but a test suite that make async requests may see its run time dominated by network and remote work latency. In these scenarios, it could make sense to have streaks (a task and its corresponding beforeEach and afterEach hooks) run in parallel.
In that scenario, having them all share a context object would make a lot of sense.
The v5 API has a nice affordance for this with the injected o object.
We could have o("some test", (o, {spy, context, timeout} = o) => {...}) or even o("", ({o, spy, context, timeout}) => {...}) (if o.o ===o).
context could prototypically inherit from the spec context passed to before and after hooks (each spec having its own context that inherits from parent specs).
A context object is necessary in parallel mode because we can't rely on the closure variables not to be clobbered by other streaks running in parallel.
We could use o.parallel(maxParallelism?, callback), or overload o.spec(name, options = {parallel: false|number}, callback).
The latter is probably preferable.
The text was updated successfully, but these errors were encountered:
This isn't a concern as far as Mithril or ospec itself are concerned, but a test suite that make async requests may see its run time dominated by network and remote work latency. In these scenarios, it could make sense to have streaks (a task and its corresponding
beforeEach
andafterEach
hooks) run in parallel.In that scenario, having them all share a context object would make a lot of sense.
The v5 API has a nice affordance for this with the injected
o
object.We could have
o("some test", (o, {spy, context, timeout} = o) => {...})
or eveno("", ({o, spy, context, timeout}) => {...})
(if o.o ===o).context
could prototypically inherit from the spec context passed tobefore
andafter
hooks (each spec having its own context that inherits from parent specs).A context object is necessary in parallel mode because we can't rely on the closure variables not to be clobbered by other streaks running in parallel.
We could use
o.parallel(maxParallelism?, callback)
, or overloado.spec(name, options = {parallel: false|number}, callback)
.The latter is probably preferable.
The text was updated successfully, but these errors were encountered: