Skip to content

Commit

Permalink
Less brittle testing for abort controller
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Nov 12, 2022
1 parent d48b727 commit 619de34
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions simple-git/test/integration/plugin.abort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ describe('timeout', () => {

const repos = await Promise.all('abcdef'.split('').map((p) => context.dir(p)));

await Promise.all(
repos.map((baseDir) => {
const git = newSimpleGit({ baseDir, abort });
if (baseDir.endsWith('a')) {
return promiseError(git.init().then(() => controller.abort()));
}

return promiseError(git.clone(upstream, baseDir));
})
);
repos.map((baseDir) => {
const git = newSimpleGit({ baseDir, abort });
if (baseDir.endsWith('a')) {
return promiseError(git.init());
}
return promiseError(git.clone(upstream, baseDir));
});

await wait(0);
controller.abort();

const results = await Promise.all(
repos.map((baseDir) => newSimpleGit(baseDir).checkIsRepo())
Expand Down

0 comments on commit 619de34

Please sign in to comment.