Skip to content

Commit 1e433fc

Browse files
committed
undo changes in run script
1 parent a562ae6 commit 1e433fc

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

dev-packages/e2e-tests/run.ts

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,21 @@
11
/* eslint-disable no-console */
22
import { spawn } from 'child_process';
3-
import { resolve } from 'path';
43
import * as dotenv from 'dotenv';
54
import { sync as globSync } from 'glob';
5+
import { resolve } from 'path';
66

7-
import { readFileSync } from 'fs';
87
import { registrySetup } from './registrySetup';
98

109
const DEFAULT_DSN = 'https://username@domain/123';
1110
const DEFAULT_SENTRY_ORG_SLUG = 'sentry-javascript-sdks';
1211
const DEFAULT_SENTRY_PROJECT = 'sentry-javascript-e2e-tests';
1312

14-
interface PackageJson {
15-
volta?: {
16-
node?: string;
17-
};
18-
}
19-
20-
function getVoltaNodeVersion(packageJsonPath: string): string | undefined {
21-
try {
22-
const packageJson: PackageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
23-
return packageJson.volta?.node;
24-
} catch {
25-
return undefined;
26-
}
27-
}
28-
2913
function asyncExec(
3014
command: string,
3115
options: { env: Record<string, string | undefined>; cwd: string; nodeVersion?: string },
3216
): Promise<void> {
3317
return new Promise((resolve, reject) => {
34-
const finalCommand = options.nodeVersion ? `volta run --node ${options.nodeVersion} ${command}` : command;
35-
const process = spawn(finalCommand, { ...options, shell: true });
18+
const process = spawn(command, { ...options, shell: true });
3619

3720
process.stdout.on('data', data => {
3821
console.log(`${data}`);
@@ -95,13 +78,12 @@ async function run(): Promise<void> {
9578

9679
for (const testAppPath of testAppPaths) {
9780
const cwd = resolve('test-applications', testAppPath);
98-
const nodeVersion = getVoltaNodeVersion(resolve(cwd, 'package.json'));
9981

10082
console.log(`Building ${testAppPath}...`);
101-
await asyncExec('pnpm test:build', { env, cwd, nodeVersion });
83+
await asyncExec('pnpm test:build', { env, cwd });
10284

10385
console.log(`Testing ${testAppPath}...`);
104-
await asyncExec('pnpm test:assert', { env, cwd, nodeVersion });
86+
await asyncExec('pnpm test:assert', { env, cwd });
10587
}
10688
} catch (error) {
10789
console.error(error);

0 commit comments

Comments
 (0)