We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4c588e commit b6ab945Copy full SHA for b6ab945
src/index-ci.test.ts
@@ -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