-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathextension.spec.js
32 lines (28 loc) · 1.08 KB
/
extension.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { activate } = require("./extension");
const { setupGitMob } = require("./src/setup-git-mob");
const { waitForRepos } = require("./src/wait-for-repos");
const {
installGitCoAuthorFile,
} = require("./src/install/install-git-coauthor-file");
jest.mock("./src/setup-git-mob");
jest.mock("./src/vscode-git-extension/git-ext");
jest.mock("./src/wait-for-repos");
jest.mock("./src/install/install-git-coauthor-file");
describe("Activate Git Mob extension", function () {
beforeAll(() => {
waitForRepos.mockImplementation((_git, callback) => {
callback();
});
});
it("confirm execution order", async function () {
await activate();
const first = installGitCoAuthorFile.mock.invocationCallOrder[0];
const second = waitForRepos.mock.invocationCallOrder[0];
const third = setupGitMob.mock.invocationCallOrder[0];
expect(first).toBeLessThan(second);
expect(second).toBeLessThan(third);
expect(installGitCoAuthorFile).toHaveBeenCalledTimes(1);
expect(waitForRepos).toHaveBeenCalledTimes(1);
expect(setupGitMob).toHaveBeenCalledTimes(1);
});
});