Skip to content

Commit 619de34

Browse files
committed
Less brittle testing for abort controller
1 parent d48b727 commit 619de34

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

simple-git/test/integration/plugin.abort.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ describe('timeout', () => {
3232

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

35-
await Promise.all(
36-
repos.map((baseDir) => {
37-
const git = newSimpleGit({ baseDir, abort });
38-
if (baseDir.endsWith('a')) {
39-
return promiseError(git.init().then(() => controller.abort()));
40-
}
41-
42-
return promiseError(git.clone(upstream, baseDir));
43-
})
44-
);
35+
repos.map((baseDir) => {
36+
const git = newSimpleGit({ baseDir, abort });
37+
if (baseDir.endsWith('a')) {
38+
return promiseError(git.init());
39+
}
40+
return promiseError(git.clone(upstream, baseDir));
41+
});
42+
43+
await wait(0);
44+
controller.abort();
4545

4646
const results = await Promise.all(
4747
repos.map((baseDir) => newSimpleGit(baseDir).checkIsRepo())

0 commit comments

Comments
 (0)