Add SSR bundle minify config
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, it, expect, afterEach } from "bun:test";
|
||||
import shouldMinifySSR from "../../utils/should-minify-ssr";
|
||||
|
||||
const originalEnv = process.env.NODE_ENV;
|
||||
|
||||
afterEach(() => {
|
||||
process.env.NODE_ENV = originalEnv;
|
||||
});
|
||||
|
||||
describe("shouldMinifySSR", () => {
|
||||
it("never minifies in development", () => {
|
||||
process.env.NODE_ENV = "development";
|
||||
expect(shouldMinifySSR()).toBe(false);
|
||||
expect(shouldMinifySSR({ minify_ssr_bundle: true })).toBe(false);
|
||||
expect(shouldMinifySSR({ minify_ssr_bundle: false })).toBe(false);
|
||||
});
|
||||
|
||||
it("minifies in production by default", () => {
|
||||
process.env.NODE_ENV = "production";
|
||||
expect(shouldMinifySSR()).toBe(true);
|
||||
expect(shouldMinifySSR({ minify_ssr_bundle: true })).toBe(true);
|
||||
});
|
||||
|
||||
it("skips minification when minify_ssr_bundle is false", () => {
|
||||
process.env.NODE_ENV = "production";
|
||||
expect(shouldMinifySSR({ minify_ssr_bundle: false })).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user