File tree Expand file tree Collapse file tree 7 files changed +37
-144
lines changed
Expand file tree Collapse file tree 7 files changed +37
-144
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,12 @@ permissions:
55jobs :
66 build :
77 runs-on : ubuntu-latest
8- strategy :
9- matrix :
10- node-version : [22, 24]
118 steps :
129 - uses : actions/checkout@v4
13- - name : Use Node.js ${{ matrix.node-version }}
10+ - name : Use Node.js
1411 uses : actions/setup-node@v4
1512 with :
16- node-version : ${{ matrix.node-version }}
13+ node-version : 24
1714 cache : npm
1815 - run : npm install
1916 - run : npx playwright install chromium
Original file line number Diff line number Diff line change 1818 "prebuild" : " npm run clean && npm run compile" ,
1919 "compile" : " tsc" ,
2020 "build" : " rollup -c" ,
21- "test" : " npm run lint && node test-runner.js " ,
21+ "test" : " npm run lint && ./scripts/ test-with-server.sh " ,
2222 "prepublishOnly" : " npm run build" ,
2323 "postpublish" : " npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
2424 },
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Start the WebSocket server in the background
4+ node -e "
5+ const ws = require('nodejs-websocket');
6+ ws.createServer(function (conn) {
7+ conn.on('text', function (msg) {
8+ if (msg.startsWith('echo:')) {
9+ conn.sendText(msg.replace('echo:', ''));
10+ } else if (msg.startsWith('close:')) {
11+ const code = msg.replace('close:', '');
12+ conn.close(parseInt(code), 'reason');
13+ }
14+ });
15+ conn.on('error', function (error) {
16+ if (error.code !== 'ECONNRESET') throw error;
17+ });
18+ }).listen(7999, () => console.log('WebSocket server ready'));
19+ " &
20+
21+ SERVER_PID=$!
22+
23+ # Wait for server to be ready
24+ sleep 1
25+
26+ # Run vitest
27+ npx vitest run
28+ TEST_EXIT=$?
29+
30+ # Kill the server
31+ kill $SERVER_PID 2> /dev/null
32+
33+ exit $TEST_EXIT
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77 "env" : {
88 "browser" : true
99 },
10- "globals" : {
11- "describe" : " readonly" ,
12- "it" : " readonly" ,
13- "expect" : " readonly"
14- },
1510 "rules" : {
1611 "import/named" : " off"
1712 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default defineConfig({
1212 } ,
1313 ] ,
1414 } ,
15- include : [ 'test/**/ test.js' ] ,
15+ include : [ 'test/test* .js' ] ,
1616 testTimeout : 10000 ,
1717 } ,
1818} )
You can’t perform that action at this time.
0 commit comments