Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit ea3f483

Browse files
committed
Fix: Race condition in getRemoteUrl test
- Removed a race condition for the `getRemoteUrl` tests caused by the test functions being both `async` as well as using a `done` callback.
1 parent ead0d68 commit ea3f483

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/commands/service/create-revision.test.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,11 @@ describe("Create pull request", () => {
250250
});
251251

252252
describe("test getRemoteUrl function", () => {
253-
it("sanity test: get original url", async (done) => {
254-
const res = await getRemoteUrl(undefined);
255-
expect(!!res.match(/(.*?)\/spk/i)).toBe(true);
256-
done();
253+
it("sanity test: get original url", () => {
254+
expect(getRemoteUrl(undefined)).resolves.toMatch(/(.*?)\/spk/i);
257255
});
258-
it("sanity test", async (done) => {
259-
const res = await getRemoteUrl("https://github.com/CatalystCode/spk1");
260-
expect(res).toBe("https://github.com/CatalystCode/spk1");
261-
done();
256+
it("sanity test", () => {
257+
const url = "https://github.com/CatalystCode/spk1";
258+
expect(getRemoteUrl(url)).resolves.toBe(url);
262259
});
263260
});

0 commit comments

Comments
 (0)