Skip to content

Commit 2074464

Browse files
committed
use different env
1 parent b796df6 commit 2074464

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/integration-tests/fixtures/disabled-sourcemaps-upload/disabled-sourcemaps-upload.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function getGlobalWithDebugIdUploads(): typeof global & {
1010
}
1111

1212
test("should not call upload plugin when sourcemaps are disabled", async () => {
13+
process.env["SENTRY_NODE_ENV"] = "test";
1314
const gbl = getGlobalWithDebugIdUploads();
1415
gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__ = false;
1516

@@ -26,9 +27,11 @@ test("should not call upload plugin when sourcemaps are disabled", async () => {
2627
});
2728

2829
expect(gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__).toBe(false);
30+
delete process.env["SENTRY_NODE_ENV"];
2931
});
3032

3133
test("should call upload plugin when sourcemaps are enabled", async () => {
34+
process.env["SENTRY_NODE_ENV"] = "test";
3235
const gbl = getGlobalWithDebugIdUploads();
3336
gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__ = false;
3437

@@ -42,4 +45,5 @@ test("should call upload plugin when sourcemaps are enabled", async () => {
4245
});
4346

4447
expect(gbl.__SENTRY_DEBUG_ID_UPLOAD_TEST__).toBe(true);
48+
delete process.env["SENTRY_NODE_ENV"];
4549
});

packages/rollup-plugin/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function rollupDebugIdUploadPlugin(
4646
createDependencyOnBuildArtifacts: () => () => void
4747
): UnpluginOptions {
4848
// Only for testing purposes
49-
if (process.env["NODE_ENV"] === "test") {
49+
if (process.env["SENTRY_NODE_ENV"] === "test") {
5050
if ("__SENTRY_DEBUG_ID_UPLOAD_TEST__" in global) {
5151
global.__SENTRY_DEBUG_ID_UPLOAD_TEST__ = true;
5252
}

0 commit comments

Comments
 (0)