Skip to content

Commit 6be097c

Browse files
authored
test: Fix failing integration tests on Windows (#807)
* Revert "feat(core): Explicitly allow `undefined` as value for `authToken` option (#805)" This reverts commit 73787df. * Revert "Revert "feat(core): Explicitly allow `undefined` as value for `authToken` option (#805)"" This reverts commit 4ac2dc2. * some debug logging * . * .. * ... * .... * use posix? * try rollup w/ posix * move input file into rollup dir * check and add * wtf * more logging * so __dirname is the problem? * try w/o __dirname * fileURLToPath * simplify * avoid posix * use move bundle.js into webpack dir * use basename * dirname, not basename * start ci? * delete per-dir bundle.js, use fileUrlToPath everywhere
1 parent 298fb12 commit 6be097c

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

packages/integration-tests/fixtures/debug-ids-already-injected/debug-ids-already-injected.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ describeNode18Plus("vite 6 bundle", () => {
5656
});
5757

5858
describeNode18Plus("webpack 5 bundle", () => {
59-
const viteRoot = path.join(__dirname, "input", "webpack5");
59+
const webpackRoot = path.join(__dirname, "input", "webpack5");
6060
const tempDir = createTempDir();
6161

6262
beforeEach(() => {
63-
execSync("yarn install", { cwd: viteRoot, stdio: "inherit" });
63+
execSync("yarn install", { cwd: webpackRoot, stdio: "inherit" });
6464
execSync("yarn webpack build", {
65-
cwd: viteRoot,
65+
cwd: webpackRoot,
6666
stdio: "inherit",
6767
env: { ...process.env, SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir },
6868
});
@@ -81,13 +81,13 @@ describeNode18Plus("webpack 5 bundle", () => {
8181
});
8282

8383
describeNode18Plus("rollup bundle", () => {
84-
const viteRoot = path.join(__dirname, "input", "rollup4");
84+
const rollupRoot = path.join(__dirname, "input", "rollup4");
8585
const tempDir = createTempDir();
8686

8787
beforeEach(() => {
88-
execSync("yarn install", { cwd: viteRoot, stdio: "inherit" });
88+
execSync("yarn install", { cwd: rollupRoot, stdio: "inherit" });
8989
execSync("yarn rollup --config rollup.config.js", {
90-
cwd: viteRoot,
90+
cwd: rollupRoot,
9191
stdio: "inherit",
9292
env: { ...process.env, SENTRY_TEST_OVERRIDE_TEMP_DIR: tempDir },
9393
});

packages/integration-tests/fixtures/debug-ids-already-injected/input/rollup4/rollup.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { defineConfig } from "rollup";
22
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
3-
import { join } from "path";
3+
import { join, dirname } from "path";
4+
import { fileURLToPath } from "url";
45

5-
const __dirname = new URL(".", import.meta.url).pathname;
6+
const __dirname = dirname(fileURLToPath(import.meta.url));
67

78
export default defineConfig({
89
input: { index: join(__dirname, "..", "bundle.js") },

packages/integration-tests/fixtures/debug-ids-already-injected/input/vite6/vite.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { defineConfig } from "vite";
22
import { sentryVitePlugin } from "@sentry/vite-plugin";
3-
import { join } from "path";
3+
import { join, dirname } from "path";
4+
import { fileURLToPath } from "url";
5+
6+
const __dirname = dirname(fileURLToPath(import.meta.url));
47

58
export default defineConfig({
69
clearScreen: false,

packages/integration-tests/fixtures/debug-ids-already-injected/input/webpack5/webpack.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { sentryWebpackPlugin } from "@sentry/webpack-plugin";
2-
import { join } from "path";
2+
import { join, dirname } from "path";
3+
import { fileURLToPath } from "url";
34

4-
const __dirname = new URL(".", import.meta.url).pathname;
5+
const __dirname = dirname(fileURLToPath(import.meta.url));
56

67
export default {
78
devtool: "source-map-debugids",

0 commit comments

Comments
 (0)