Skip to content

Commit 0a89c2f

Browse files
authored
test: Vite integration tests (#899)
1 parent 0694741 commit 0a89c2f

File tree

158 files changed

+3193
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+3193
-213
lines changed

packages/babel-plugin-component-annotate/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"eslint": "^8.18.0",
5959
"vitest": "^4.0.0",
6060
"premove": "^4.0.0",
61-
"rolldown": "^1.0.0-rc.6",
61+
"rolldown": "1.0.0-rc.10",
6262
"ts-node": "^10.9.1",
6363
"typescript": "^4.7.4"
6464
},

packages/bundler-plugin-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"eslint": "^8.18.0",
7373
"vitest": "^4.0.0",
7474
"premove": "^4.0.0",
75-
"rolldown": "^1.0.0-rc.6",
75+
"rolldown": "1.0.0-rc.10",
7676
"typescript": "^4.7.4"
7777
},
7878
"volta": {

packages/esbuild-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"eslint": "^8.18.0",
5858
"vitest": "^4.0.0",
5959
"premove": "^4.0.0",
60-
"rolldown": "^1.0.0-rc.6",
60+
"rolldown": "1.0.0-rc.10",
6161
"ts-node": "^10.9.1",
6262
"typescript": "^4.7.4"
6363
},

packages/integration-tests-next/.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
module.exports = {
33
root: true,
44
extends: ["@sentry-internal/eslint-config/base"],
5-
ignorePatterns: [".eslintrc.js", "fixtures/*/out", "fixtures/*/src"],
5+
ignorePatterns: [
6+
".eslintrc.js",
7+
"fixtures/*/out",
8+
"fixtures/*/src",
9+
// We ignore Vite fixtures for now because there are a couple of version mismatches.
10+
"fixtures/vite*/**/*",
11+
],
612
parserOptions: {
713
tsconfigRootDir: __dirname,
814
project: ["./tsconfig.json"],

packages/integration-tests-next/fixtures/rolldown/after-upload-deletion.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
77
{
88
"basic.js": "//#region src/basic.js
9-
!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]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
e.SENTRY_RELEASE = { id: "CURRENT_SHA" };
13+
var n = new e.Error().stack;
14+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
15+
} catch (e) {}
16+
})();
17+
console.log("hello world");
1118
//#endregion
19+
1220
//# sourceMappingURL=basic.js.map",
1321
}
1422
`);

packages/integration-tests-next/fixtures/rolldown/application-key.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ import { test } from "./utils";
44
test(import.meta.url, ({ runBundler, readOutputFiles }) => {
55
runBundler();
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
7-
{
8-
"basic.js": "//#region src/basic.js
9-
!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"};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:1234567890abcdef":true});var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
11-
//#endregion",
12-
}
13-
`);
7+
{
8+
"basic.js": "//#region src/basic.js
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
e.SENTRY_RELEASE = { id: "CURRENT_SHA" };
13+
e._sentryModuleMetadata = e._sentryModuleMetadata || {}, e._sentryModuleMetadata[new e.Error().stack] = function(e) {
14+
for (var n = 1; n < arguments.length; n++) {
15+
var a = arguments[n];
16+
if (null != a) for (var t in a) a.hasOwnProperty(t) && (e[t] = a[t]);
17+
}
18+
return e;
19+
}({}, e._sentryModuleMetadata[new e.Error().stack], { "_sentryBundlerPluginAppKey:1234567890abcdef": true });
20+
var n = new e.Error().stack;
21+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
22+
} catch (e) {}
23+
})();
24+
console.log("hello world");
25+
//#endregion
26+
",
27+
}
28+
`);
1429
});

packages/integration-tests-next/fixtures/rolldown/basic-release-disabled.test.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ import { test } from "./utils";
44
test(import.meta.url, ({ runBundler, readOutputFiles }) => {
55
runBundler();
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
7-
{
8-
"basic.js": "//#region src/basic.js
9-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
11-
//#endregion",
12-
}
13-
`);
7+
{
8+
"basic.js": "//#region src/basic.js
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
var n = new e.Error().stack;
13+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
14+
} catch (e) {}
15+
})();
16+
console.log("hello world");
17+
//#endregion
18+
",
19+
}
20+
`);
1421
});

packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
77
{
88
"basic.js": "//#region src/basic.js
9-
!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]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
e.SENTRY_RELEASE = { id: "CURRENT_SHA" };
13+
var n = new e.Error().stack;
14+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
15+
} catch (e) {}
16+
})();
17+
console.log("hello world");
1118
//#endregion
19+
1220
//# sourceMappingURL=basic.js.map",
13-
"basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";scACA,OAAA,CAAQ,GAAA,CAAI,CAAA,KAAA,CAAA,KAAA,CAAA,CAAc"}",
21+
"basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";;;;;;;;;AACA,QAAQ,IAAI,cAAc"}",
1422
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
1523
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
1624
["releases","finalize","CURRENT_SHA"],

packages/integration-tests-next/fixtures/rolldown/basic.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => {
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
77
{
88
"basic.js": "//#region src/basic.js
9-
!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]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
11-
//#endregion",
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
e.SENTRY_RELEASE = { id: "CURRENT_SHA" };
13+
var n = new e.Error().stack;
14+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
15+
} catch (e) {}
16+
})();
17+
console.log("hello world");
18+
//#endregion
19+
",
1220
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
1321
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
1422
["releases","finalize","CURRENT_SHA"],

packages/integration-tests-next/fixtures/rolldown/build-info.test.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,26 @@ test(import.meta.url, ({ runBundler, readOutputFiles }) => {
66
expect(readOutputFiles()).toMatchInlineSnapshot(`
77
{
88
"basic.js": "//#region src/basic.js
9-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"build-information-injection-test"};e.SENTRY_BUILD_INFO={"deps":["@sentry/rollup-plugin","react","rolldown"],"depsVersions":{"react":19},"nodeVersion":"NODE_VERSION"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10-
11-
//#endregion",
9+
(function() {
10+
try {
11+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
12+
e.SENTRY_RELEASE = { id: "build-information-injection-test" };
13+
e.SENTRY_BUILD_INFO = {
14+
"deps": [
15+
"@sentry/rollup-plugin",
16+
"react",
17+
"rolldown"
18+
],
19+
"depsVersions": { "react": 19 },
20+
"nodeVersion":"NODE_VERSION"
21+
};
22+
var n = new e.Error().stack;
23+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b699d9c1-b033-4536-aa25-233c92609b54", e._sentryDebugIdIdentifier = "sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");
24+
} catch (e) {}
25+
})();
26+
console.log("hello world");
27+
//#endregion
28+
",
1229
}
1330
`);
1431
});

0 commit comments

Comments
 (0)