forked from getsentry/sentry-javascript-bundler-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-release-injection.test.ts
More file actions
33 lines (28 loc) · 879 Bytes
/
basic-release-injection.test.ts
File metadata and controls
33 lines (28 loc) · 879 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
27
28
29
30
31
32
33
import childProcess from "child_process";
import path from "path";
/**
* Runs a node file in a seprate process.
*
* @param bundlePath Path of node file to run
* @returns Stdout of the process
*/
function checkBundle(bundlePath: string): void {
const processOutput = childProcess.execSync(`node ${bundlePath}`, { encoding: "utf-8" });
expect(processOutput).toBe("I AM A RELEASE!");
}
test("esbuild bundle", () => {
expect.assertions(1);
checkBundle(path.join(__dirname, "./out/esbuild/index.js"));
});
test("rollup bundle", () => {
expect.assertions(1);
checkBundle(path.join(__dirname, "./out/rollup/index.js"));
});
test("vite bundle", () => {
expect.assertions(1);
checkBundle(path.join(__dirname, "./out/vite/index.js"));
});
test("webpack 5 bundle", () => {
expect.assertions(1);
checkBundle(path.join(__dirname, "./out/webpack/index.js"));
});