| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4275fd5 commit 70bf934
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + module.exports = { | ||
| 2 | + entry: "hey" | ||
| 3 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 1 | + "use strict"; | ||
| 2 | + | ||
| 3 | + const validation = require("../../../../bin/utils/validate-options"); | ||
| 4 | + const { run } = require("../../../testUtils"); | ||
| 5 | + | ||
| 6 | + test("validation", () => { | ||
| 7 | + const mockExit = jest.spyOn(process, "exit").mockImplementation(() => {}); | ||
| 8 | + validation(null); | ||
| 9 | + expect(mockExit).toHaveBeenCalledWith(-1); | ||
| 10 | + mockExit.mockRestore(); | ||
| 11 | + }); | ||
| 12 | + | ||
| 13 | + test("validation-success", () => { | ||
| 14 | + const { stdout, code } = run(__dirname, ["--config", "./options.js"]); | ||
| 15 | + expect(stdout).toContain("Can't resolve 'hey'"); | ||
| 16 | + expect(code).toBe(2); | ||
| 17 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments