Skip to content

Commit

Permalink
Merge pull request #22 from microsoft/connor4312/0.0.6
Browse files Browse the repository at this point in the history
fix: preserve order when resolving configurations
  • Loading branch information
connor4312 authored Feb 7, 2024
2 parents 11a07ce + 5de3842 commit 9f939e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vscode/test-cli",
"version": "0.0.5",
"version": "0.0.6",
"description": "Command-line runner for VS Code extension tests",
"scripts": {
"prepack": "npm run build",
Expand Down
12 changes: 5 additions & 7 deletions src/bin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ async function prepareConfigs(
config: ResolvedTestConfiguration,
enabledTests: Set<TestConfiguration>,
): Promise<IPreparedRun[]> {
const prepared: IPreparedRun[] = [];
await Promise.all(
return await Promise.all(
[...enabledTests].map(async (test, i) => {
for (const platform of platforms) {
const p = await platform.prepare({ args, config, test });
if (p) {
prepared.push(p);
return;
return p;
}
}

Expand All @@ -81,8 +79,6 @@ async function prepareConfigs(
);
}),
);

return prepared;
}

const WATCH_RUN_DEBOUNCE = 500;
Expand Down Expand Up @@ -173,7 +169,9 @@ async function runPreparedConfigs(
async function runConfigs(config: ResolvedTestConfiguration, enabledTests: Set<TestConfiguration>) {
const prepared = await prepareConfigs(config, enabledTests);
if (args.listConfiguration) {
console.log(JSON.stringify(prepared.map((p) => p.dumpJson())));
await new Promise((r) =>
process.stdout.write(JSON.stringify(prepared.map((p) => p.dumpJson())), r),
);
return 0;
}

Expand Down

0 comments on commit 9f939e3

Please sign in to comment.