Skip to content

Commit 413ca41

Browse files
test: run SDK packaging regression check via Bun (#121)
* test: run sdk type packaging check via bun * style: format bun tsc regression test * ci: run tests in pull request workflow * test: raise sdk packaging timeout for ci
1 parent 588675a commit 413ca41

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333

3434
- name: Run linter
3535
run: bun run lint
36+
37+
- name: Run tests
38+
run: bun test
3639

3740
- name: Build project
3841
run: bun run build:js && bun run build:types

tests/sdk-types.test.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ import { tmpdir } from 'node:os';
55
import { join } from 'node:path';
66

77
const repoRoot = process.cwd();
8-
const tscPath = join(
9-
repoRoot,
10-
'node_modules',
11-
'.bin',
12-
process.platform === 'win32' ? 'tsc.cmd' : 'tsc'
13-
);
8+
const bunPath = process.execPath;
149

1510
function run(command: string, args: string[], cwd: string) {
1611
const result = spawnSync(command, args, {
@@ -33,7 +28,7 @@ describe('SDK type packaging', () => {
3328

3429
try {
3530
const distDir = join(tempDir, 'dist');
36-
run(tscPath, ['--project', 'tsconfig.build.json', '--outDir', distDir], repoRoot);
31+
run(bunPath, ['x', 'tsc', '--project', 'tsconfig.build.json', '--outDir', distDir], repoRoot);
3732

3833
const consumerPath = join(tempDir, 'consumer.ts');
3934
const normalizedDistDir = distDir.replaceAll('\\', '/');
@@ -84,8 +79,10 @@ describe('SDK type packaging', () => {
8479
);
8580

8681
run(
87-
tscPath,
82+
bunPath,
8883
[
84+
'x',
85+
'tsc',
8986
'--pretty',
9087
'false',
9188
'--noEmit',
@@ -104,5 +101,5 @@ describe('SDK type packaging', () => {
104101
} finally {
105102
rmSync(tempDir, { recursive: true, force: true });
106103
}
107-
}, 20000);
104+
}, 60000);
108105
});

0 commit comments

Comments
 (0)