-
-
Notifications
You must be signed in to change notification settings - Fork 673
Expand file tree
/
Copy pathcustom-webpack.test.js
More file actions
26 lines (21 loc) · 751 Bytes
/
custom-webpack.test.js
File metadata and controls
26 lines (21 loc) · 751 Bytes
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
"use strict";
const { resolve } = require("node:path");
const { run } = require("../../utils/test-utils");
describe("custom-webpack", () => {
it("should use package from 'node_modules'", async () => {
const { exitCode, stderr, stdout } = await run(__dirname, [], {
env: { WEBPACK_PACKAGE: "webpack" },
});
expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain("main.js");
});
it("should use custom-webpack.js", async () => {
const { exitCode, stderr, stdout } = await run(__dirname, [], {
env: { WEBPACK_PACKAGE: resolve(__dirname, "./custom-webpack.js") },
});
expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain("main.js");
});
});