mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
fix(lx-trading-ts): run all the tests, and stop exiting 1 on a passing suite
The TypeScript SDK job failed at "Run tests with coverage" while reporting
`# pass 25 # fail 0`. Two separate defects, and the second hid the first.
1. The shell ate two thirds of the suite. `npm test` was
node --test --experimental-test-coverage dist/**/*.test.js
unquoted, so the SHELL expanded the glob. bash has no globstar by default, so
`**` degrades to `*` and matches exactly one level down:
dist/**/*.test.js -> dist/arbitrage/scanner.test.js
dist/arbitrage/types.test.js
The four top-level suites -- risk, orderbook, math, types -- were never run in
CI. It looked green-ish because the files it DID run passed. Quoting the glob
hands expansion to node, which walks recursively: 25 tests -> 158.
(zsh expands `**` recursively, so this is invisible from a dev machine. It only
drops tests on the runner.)
2. Node 20 crashed reporting coverage, after passing:
# Warning: Could not report code coverage.
TypeError: Cannot read properties of undefined (reading 'line')
# pass 25 # fail 0 <- then exit 1
Measured across versions with the quoted glob: 18 exit 1, 22 exit 0, 24 exit 0,
26 exit 0. Node 18 cannot expand the pattern at all, and both 18 and 20 are
EOL, so `engines` moves to >=22.0.0 to state what actually works rather than a
floor that does not.
sdk-publish.yml pinned NODE_VERSION 20 as well; left alone it would now fail
EBADENGINE against that floor.
Verified locally on node 22 with the CI commands:
npx tsc --noEmit CLEAN
npm run build CLEAN
npm test 158 tests, 158 pass, 0 fail, exit 0
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -93,7 +93,7 @@ jobs:
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '22'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: sdk/lx-trading-ts/package-lock.json
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ permissions:
|
||||
id-token: write # For PyPI trusted publishing
|
||||
|
||||
env:
|
||||
NODE_VERSION: '20'
|
||||
NODE_VERSION: '22'
|
||||
PYTHON_VERSION: '3.11'
|
||||
RUST_VERSION: 'stable'
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"build": "tsc",
|
||||
"clean": "rm -rf dist",
|
||||
"prepublishOnly": "npm run clean && npm run build",
|
||||
"test": "node --test --experimental-test-coverage dist/**/*.test.js",
|
||||
"test": "node --test --experimental-test-coverage \"dist/**/*.test.js\"",
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -52,6 +52,6 @@
|
||||
"typescript": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user