-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathbundle-size-optimizations.test.ts
More file actions
35 lines (33 loc) · 1.18 KB
/
bundle-size-optimizations.test.ts
File metadata and controls
35 lines (33 loc) · 1.18 KB
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
34
35
import { expect } from "vitest";
import { test } from "./utils";
test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
runBundler();
expect(readOutputFiles()).toMatchInlineSnapshot(`
{
"bundle.js": "//#region src/bundle.js
(function() {
try {
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
e.SENTRY_RELEASE = { id: "CURRENT_SHA" };
var n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "92a38845-d1ee-42b4-9812-67a76e42b480", e._sentryDebugIdIdentifier = "sentry-dbid-92a38845-d1ee-42b4-9812-67a76e42b480");
} catch (e) {}
})();
console.log(JSON.stringify({
debug: "b",
trace: "b",
replayCanvas: "a",
replayIframe: "a",
replayShadowDom: "a",
replayWorker: "a"
}));
//#endregion
",
}
`);
const output = runFileInNode("bundle.js");
expect(output).toMatchInlineSnapshot(`
"{"debug":"b","trace":"b","replayCanvas":"a","replayIframe":"a","replayShadowDom":"a","replayWorker":"a"}
"
`);
});