Skip to content

Commit f122aab

Browse files
committedOct 6, 2023
#5682 add test for bun over ts and tsx
1 parent 7bbe1a5 commit f122aab

File tree

6 files changed

+45
-37
lines changed

6 files changed

+45
-37
lines changed
 

‎.github/workflows/node.js.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v3
21+
- uses: oven-sh/setup-bun@v1
2122
- name: Use Node.js ${{ matrix.node-version }}
2223
uses: actions/setup-node@v3
2324
with:

‎lib/Common.js

-7
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,6 @@ Common.sink.resolveInterpreter = function(app) {
467467
if (app.exec_interpreter.indexOf('python') > -1)
468468
app.env.PYTHONUNBUFFERED = '1'
469469

470-
/**
471-
* Specific installed JS transpilers
472-
*/
473-
if (app.exec_interpreter == 'ts-node') {
474-
app.exec_interpreter = path.resolve(__dirname, '../node_modules/.bin/ts-node');
475-
}
476-
477470
if (app.exec_interpreter == 'lsc') {
478471
app.exec_interpreter = path.resolve(__dirname, '../node_modules/.bin/lsc');
479472
}

‎test/e2e.sh

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ runTest ./test/e2e/cli/reload.sh
1616
runTest ./test/e2e/cli/start-app.sh
1717
runTest ./test/e2e/cli/operate-regex.sh
1818
runTest ./test/e2e/cli/interpreter.sh
19+
runTest ./test/e2e/cli/bun.sh
1920
runTest ./test/e2e/cli/app-configuration.sh
2021
runTest ./test/e2e/cli/binary.sh
2122
runTest ./test/e2e/cli/startOrX.sh

‎test/e2e/cli/bun.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
SRC=$(cd $(dirname "$0"); pwd)
4+
source "${SRC}/../include.sh"
5+
6+
cd $file_path/interpreter
7+
8+
########### typescript fork test
9+
$pm2 delete all
10+
11+
>typescript.log
12+
13+
$pm2 start echo.ts -o typescript.log --merge-logs
14+
15+
sleep 1.5
16+
17+
grep "Hello Typescript!" typescript.log
18+
spec "Should work on Typescript files in fork mode"
19+
20+
# ########### typescript cluster test
21+
$pm2 delete all
22+
23+
>typescript.log
24+
25+
$pm2 start echo.tsx -o typescript.log --merge-logs
26+
27+
sleep 1.5
28+
29+
grep "Hello Typescript!" typescript.log
30+
spec "Should work on Typescript files in fork mode"
31+
32+
$pm2 delete all

‎test/e2e/cli/interpreter.sh

-30
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,3 @@ should 'process should be online' "status: 'online'" 1
7171
# sleep 1.5
7272
# grep "Hello Livescript!" livescript.log
7373
# spec "Should work on Livescript files in cluster mode"
74-
75-
########### TYPESCRIPT
76-
77-
########### Install
78-
79-
80-
# $pm2 install typescript
81-
82-
# ########### typescript fork test
83-
# $pm2 delete all
84-
85-
# >typescript.log
86-
87-
# $pm2 start echo.ts -o typescript.log --merge-logs
88-
89-
# sleep 1.5
90-
91-
# grep "Hello Typescript!" typescript.log
92-
# spec "Should work on Typescript files in fork mode"
93-
94-
# ########### typescript cluster test
95-
# $pm2 delete all
96-
97-
# >typescript.log
98-
99-
# $pm2 start echo.ts -i 1 -o typescript.log --merge-logs
100-
101-
# sleep 1.5
102-
# grep "Hello Typescript!" typescript.log
103-
# spec "Should work on Typescript files in cluster mode"

‎test/fixtures/interpreter/echo.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
class Greeter {
3+
constructor(public greeting: string) { }
4+
greet() {
5+
return this.greeting;
6+
}
7+
};
8+
9+
var greeter = new Greeter("Hello Typescript!");
10+
11+
console.log(greeter.greet());

1 commit comments

Comments
 (1)

dtmrc commented on Jan 20, 2024

@dtmrc

why use bun?

Please sign in to comment.