Skip to content

Commit e5b53ad

Browse files
test: variadic added (#4548)
1 parent f3cfbe4 commit e5b53ad

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/build/config/type/function-with-env/function-with-env.test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,33 @@ describe("function configuration", () => {
231231
expect(data).toContain("env message present");
232232
});
233233

234+
it("is able to understand multiple env flags without extra `--env`", async () => {
235+
const { exitCode, stderr, stdout } = await run(__dirname, [
236+
"--env",
237+
"isDev",
238+
"verboseStats",
239+
"envMessage",
240+
]);
241+
242+
expect(exitCode).toBe(0);
243+
expect(stderr).toBeFalsy();
244+
expect(stdout).toContain("verboseStats: true");
245+
expect(stdout).toContain("envMessage: true");
246+
// check that the verbose env is respected
247+
expect(stdout).toContain("LOG from webpack");
248+
249+
let data;
250+
251+
try {
252+
data = await readFile(resolve(__dirname, "./dist/dev.js"), "utf8");
253+
} catch (error) {
254+
expect(error).toBeNull();
255+
}
256+
257+
// check if the values from DefinePlugin make it to the compiled code
258+
expect(data).toContain("env message present");
259+
});
260+
234261
it("is able to apply last flag with same name", async () => {
235262
const { exitCode, stderr, stdout } = await run(__dirname, [
236263
"--env",

0 commit comments

Comments
 (0)