Skip to content

Commit

Permalink
clean up e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Dec 12, 2024
1 parent fd618e9 commit fb2fbd3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ console.log('Running build using esbuild version', esbuild.version);
esbuild.buildSync({
platform: 'node',
entryPoints: ['./index.ts'],
outdir: './dist',
outfile: './dist/cjs/index.js',
target: 'esnext',
format: 'cjs',
bundle: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@ console.log('Running build using esbuild version', esbuild.version);
esbuild.buildSync({
platform: 'node',
entryPoints: ['./index.ts'],
outfile: './dist/index.shimmed.mjs',
outfile: './dist/esm/index.mjs',
target: 'esnext',
format: 'esm',
bundle: true,
loader: { '.node': 'copy' },
banner: {
js: `
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
`,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ console.log('🧵 Starting ESM test');

const wait = ms => new Promise(resolve => setTimeout(resolve, ms));

function assertUnpatechedRequire() {
function assertUnpatchedRequire() {
if (typeof require !== 'undefined') {
// Test that globalThis.require is not defined by any side effects of the profiling
// https://github.com/getsentry/sentry-javascript/issues/13662
Expand All @@ -30,5 +30,5 @@ Sentry.startSpan({ name: 'Precompile test' }, async () => {
await wait(500);
});

assertUnpatechedRequire();
assertUnpatchedRequire();
console.log('✅ Require is not patched');
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"scripts": {
"typecheck": "tsc --noEmit",
"build": "node build.mjs && node build.shimmed.mjs",
"test": "node dist/index.js && node --experimental-require-module dist/index.js && node dist/index.shimmed.mjs",
"build": "node build-cjs.mjs && node build-esm.mjs",
"test": "node dist/index.js && node --experimental-require-module dist/cjs/index.js && node dist/esm/index.mjs",
"clean": "npx rimraf node_modules dist",
"test:electron": "$(pnpm bin)/electron-rebuild && playwright test",
"test:build": "pnpm run typecheck && pnpm run build",
Expand Down

0 comments on commit fb2fbd3

Please sign in to comment.