Skip to content

Commit ad14a41

Browse files
committed
test(editor): fix test setup (#13929)
The tests are always passing, because we are not generating them: https://github.com/oxc-project/oxc/actions/runs/17858412366/job/50782751216?pr=13700 introduced in #13737
1 parent dc700f5 commit ad14a41

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

editors/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"install-extension": "code --install-extension oxc_language_server.vsix --force",
197197
"server:build:debug": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server",
198198
"server:build:release": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server --release",
199-
"test": "pnpm run compile && vscode-test",
199+
"test": "cross-env TEST=true pnpm run compile && vscode-test",
200200
"type-check": "tsc --noEmit"
201201
},
202202
"devDependencies": {

editors/vscode/rolldown.config.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
import { defineConfig } from 'rolldown';
1+
import { defineConfig, type RolldownOptions } from 'rolldown';
2+
import { globSync } from 'tinyglobby';
3+
4+
const input: RolldownOptions['input'] = process.env.TEST === 'true'
5+
? globSync('tests/**/*.ts')
6+
: ['client/extension.ts'];
7+
8+
const output: RolldownOptions['output'] = {
9+
sourcemap: true,
10+
format: 'cjs',
11+
banner: `"use strict";\n`,
12+
minify: true,
13+
};
14+
15+
if (process.env.TEST === 'true') {
16+
output.dir = 'out';
17+
} else {
18+
output.file = 'out/main.js';
19+
}
220

321
export default defineConfig({
4-
input: 'client/extension.ts',
5-
output: {
6-
file: 'out/main.js',
7-
sourcemap: true,
8-
format: 'cjs',
9-
banner: `"use strict";\n`,
10-
minify: true,
11-
},
22+
input,
23+
output,
1224
external: ['vscode'],
1325
platform: 'node',
1426
transform: {

0 commit comments

Comments
 (0)