|
| 1 | +import { expect } from "vitest"; |
| 2 | +import { test } from "./utils"; |
| 3 | + |
| 4 | +test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { |
| 5 | + runBundler(); |
| 6 | + expect(readOutputFiles()).toMatchInlineSnapshot(` |
| 7 | + { |
| 8 | + "basic.js": "(() => { |
| 9 | + // _sentry-injection-stub |
| 10 | + !(function() { |
| 11 | + try { |
| 12 | + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; |
| 13 | + e.SENTRY_RELEASE = { id: "CURRENT_SHA" }; |
| 14 | + } catch (e2) { |
| 15 | + } |
| 16 | + })(); |
| 17 | +
|
| 18 | + // sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=00000000-0000-0000-0000-000000000000 |
| 19 | + !(function() { |
| 20 | + try { |
| 21 | + var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; |
| 22 | + var n = new e.Error().stack; |
| 23 | + n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "00000000-0000-0000-0000-000000000000", e._sentryDebugIdIdentifier = "sentry-dbid-00000000-0000-0000-0000-000000000000"); |
| 24 | + } catch (e2) { |
| 25 | + } |
| 26 | + })(); |
| 27 | +
|
| 28 | + // src/basic.js |
| 29 | + console.log("hello world"); |
| 30 | +
|
| 31 | + // src/basic.js?sentryDebugIdProxy=true |
| 32 | + var basic_default = void 0; |
| 33 | + })(); |
| 34 | + ", |
| 35 | + "sentry-cli-mock.json": "["releases","new","CURRENT_SHA"], |
| 36 | + ["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"], |
| 37 | + ["releases","finalize","CURRENT_SHA"], |
| 38 | + ["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"], |
| 39 | + ", |
| 40 | + } |
| 41 | + `); |
| 42 | + |
| 43 | + const output = runFileInNode("basic.js"); |
| 44 | + expect(output).toBe("hello world\n"); |
| 45 | +}); |
0 commit comments