-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathdisabled-sourcemaps-upload.test.ts
More file actions
45 lines (37 loc) · 1.12 KB
/
disabled-sourcemaps-upload.test.ts
File metadata and controls
45 lines (37 loc) · 1.12 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
36
37
38
39
40
41
42
43
44
45
import path from "path";
import * as rollup from "rollup";
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
function getGlobalWithDebugIdUploads(): typeof global & {
__SENTRY_DEBUG_ID_UPLOAD_TEST__?: boolean;
} {
return global;
}
test("should not call upload plugin when sourcemaps are disabled", async () => {
const gbl = getGlobalWithDebugIdUploads();
gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__ = false;
await rollup.rollup({
input: { bundle1: path.resolve(__dirname, "input", "bundle.js") },
plugins: [
sentryRollupPlugin({
telemetry: false,
sourcemaps: {
disable: true,
},
}),
],
});
expect(gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__).toBe(false);
});
test("should call upload plugin when sourcemaps are enabled", async () => {
const gbl = getGlobalWithDebugIdUploads();
gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__ = false;
await rollup.rollup({
input: { bundle1: path.resolve(__dirname, "input", "bundle.js") },
plugins: [
sentryRollupPlugin({
telemetry: false,
}),
],
});
expect(gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__).toBe(true);
});