|
1 | 1 | "use babel";
|
2 | 2 |
|
3 | 3 | import gitCmd from "../../lib/git-cmd";
|
4 |
| -// import { getFilePath, removeGitRoot, createGitRoot, files } from "../mocks"; |
| 4 | +import { getFilePath, removeGitRoot, createGitRoot, files } from "../mocks"; |
5 | 5 |
|
6 | 6 | describe("git.add", function () {
|
7 | 7 |
|
@@ -29,28 +29,27 @@ describe("git.add", function () {
|
29 | 29 | .toContain("--verbose");
|
30 | 30 | });
|
31 | 31 |
|
32 |
| - // describe("integration tests", function () { |
33 |
| - // |
34 |
| - // beforeEach(async function () { |
35 |
| - // await atom.packages.activatePackage("context-git"); |
36 |
| - // createGitRoot(); |
37 |
| - // this.gitRoot = getFilePath(); |
38 |
| - // atom.project.setPaths([this.gitRoot]); |
39 |
| - // await gitCmd.cmd(this.gitRoot, ["init"]); |
40 |
| - // this.gitPath = getFilePath(".git"); |
41 |
| - // }); |
42 |
| - // |
43 |
| - // afterEach(function () { |
44 |
| - // removeGitRoot(); |
45 |
| - // }); |
46 |
| - // |
47 |
| - // it("should add a file", async function () { |
48 |
| - // await gitCmd.add(this.gitRoot, getFilePath(files.t1)); |
49 |
| - // const status = await gitCmd.cmd(this.gitRoot, ["status", "--short"]); |
50 |
| - // |
51 |
| - // expect(status).toContain(`A ${files.t1}`); |
52 |
| - // }); |
53 |
| - // |
54 |
| - // }); |
| 32 | + describe("integration tests", function () { |
| 33 | + |
| 34 | + beforeEach(async function () { |
| 35 | + gitCmd.cmd.and.callThrough(); |
| 36 | + await atom.packages.activatePackage("context-git"); |
| 37 | + this.gitRoot = await createGitRoot(); |
| 38 | + |
| 39 | + this.gitPath = getFilePath(this.gitRoot, ".git"); |
| 40 | + }); |
| 41 | + |
| 42 | + afterEach(async function () { |
| 43 | + await removeGitRoot(this.gitRoot); |
| 44 | + }); |
| 45 | + |
| 46 | + it("should add a file", async function () { |
| 47 | + await gitCmd.add(this.gitRoot, getFilePath(this.gitRoot, [files.t1])); |
| 48 | + const status = await gitCmd.cmd(this.gitRoot, ["status", "--short"]); |
| 49 | + |
| 50 | + expect(status).toContain(`A ${files.t1}`); |
| 51 | + }); |
| 52 | + |
| 53 | + }); |
55 | 54 |
|
56 | 55 | });
|
0 commit comments