Skip to content

Commit b6ab945

Browse files
committed
Increase coverage
1 parent a4c588e commit b6ab945

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/index-ci.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
process.env.ESLINT_PLUGIN_DIFF_COMMIT = "some-branch";
2+
process.env.CI = "true";
3+
import * as child_process from "child_process";
4+
5+
jest.mock("child_process");
6+
const mockedChildProcess = jest.mocked(child_process, { shallow: true });
7+
mockedChildProcess.execFileSync.mockReturnValue(
8+
Buffer.from("line1\nline2\nline3")
9+
);
10+
11+
import "./index";
12+
13+
describe("CI", () => {
14+
it("should diff against origin", () => {
15+
expect(process.env.CI).toBeDefined();
16+
expect(process.env.ESLINT_PLUGIN_DIFF_COMMIT).toEqual("origin/some-branch");
17+
});
18+
});

0 commit comments

Comments
 (0)