Skip to content

Commit 3860f1c

Browse files
[TS] Fixup TS test run at CI (#9004)
1 parent 4e582b0 commit 3860f1c

6 files changed

Lines changed: 13 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ jobs:
545545
# FIXME: make test script not rely on flatc
546546
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j
547547
- name: pnpm
548-
run: npm install -g pnpm esbuild
548+
run: npm install -g pnpm
549549
- name: deps
550550
run: pnpm i
551551
- name: compile

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- tests/ts

tests/ts/TypeScriptTest.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,10 @@ def flatc(
6262

6363
# Execute esbuild with the specified parameters
6464
def esbuild(input, output):
65-
cmd = ["esbuild", input, "--outfile=" + output]
65+
cmd = ["../../node_modules/.bin/esbuild", input, "--outfile=" + output]
6666
cmd += ["--format=cjs", "--bundle", "--external:flatbuffers"]
6767
check_call(cmd)
6868

69-
70-
print("Removing node_modules/ directory...")
71-
shutil.rmtree(Path(tests_path, "node_modules"), ignore_errors=True)
72-
73-
check_call(["npm", "install", "--silent"])
74-
7569
flatc(
7670
options=[
7771
"--ts",
@@ -228,12 +222,12 @@ def esbuild(input, output):
228222
)
229223

230224
print("Running TypeScript Compiler...")
231-
check_call(["tsc"])
225+
check_call(["../../node_modules/.bin/tsc"])
232226
print(
233227
"Running TypeScript Compiler in old node resolution mode for"
234228
" no_import_ext..."
235229
)
236-
check_call(["tsc", "-p", "./tsconfig.node.json"])
230+
check_call(["../../node_modules/.bin/tsc", "-p", "./tsconfig.node.json"])
237231

238232
NODE_CMD = ["node"]
239233

tests/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "module",
33
"dependencies": {
4-
"flatbuffers": "../../"
4+
"flatbuffers": "workspace:*"
55
}
66
}

tests/ts/pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)