Closed raix closed 7 years ago
...or
test('should stop on entry', async () => {
await dc.configurationSequence();
await dc.launch({ program: "main.js", stopOnEntry: true });
await dc.assertStoppedLocation('entry', 1);
});
The use of Promise.all
runs things in parallel (which is the intended behaviour). However, since configurationSequence
waits for an initialized event and assertStoppedLocation
waits for a stopped event, launch
is the only thing that proceeds and generates the 'initialized' event. This makes the configurationSequence
proceed. Later an 'stopped' event arrives which makes assertStoppedLocation
succeed.
So it is not 'dc' that handles sequential execution in a generic way but the individual utility methods do this. It would have clearer if the names of the methods would contain a "wait" to better reflect this.
Your strictly sequential snippets 2 and 3 would work too, but setting up event handlers in parallel better reflects the way VS Code works.
Thanks for the answer, I ended up with a mix.
Should this run in sequence or does dc handle this for us?
or