Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

Commit 4fcddca

Browse files
committed
fix: Update global check integration test
1 parent 0d42c3b commit 4fcddca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

example/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ console.log();
88

99
const content = fs.readFileSync('./dist/main.bundle.js');
1010
if (
11-
content.toString().match(`(window || global || self).SENTRY_RELEASE = {
11+
content.toString()
12+
.indexOf(`(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}).SENTRY_RELEASE = {
1213
id: "foo"
13-
}`)
14+
}`) !== -1
1415
) {
1516
console.log('Saul Goodman, found SENTRY_RELEASE in bundle');
1617
process.exit(0);

src/sentry.loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function sentryLoader(content, map, meta) {
22
const { releasePromise } = this.query;
33
const callback = this.async();
44
releasePromise.then(version => {
5-
const sentryRelease = `(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : self).SENTRY_RELEASE={id:"${version}"};`;
5+
const sentryRelease = `(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}).SENTRY_RELEASE={id:"${version}"};`;
66
callback(null, sentryRelease, map, meta);
77
});
88
};

0 commit comments

Comments
 (0)