Skip to content

Commit 6e9d722

Browse files
authored
Merge pull request #6529 from BitGo/CAAS-325-dist
fix: run test in /dist to avoid strip-only mode for node 24
2 parents 09bd76d + 868a01a commit 6e9d722

File tree

7 files changed

+875
-30
lines changed

7 files changed

+875
-30
lines changed

modules/sdk-coin-trx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"prepare": "npm run build-ts && shx cp -r ./resources ./dist",
1515
"test": "npm run coverage",
1616
"coverage": "nyc -- npm run unit-test",
17-
"unit-test": "yarn run build && node --test",
17+
"unit-test": "yarn run build && node --test dist/test/**/*.js",
1818
"gen-protobuf": "pbjs -t static-module -w commonjs -o ./resources/protobuf/tron.js ./resources/protobuf/Discover.proto ./resources/protobuf/Contract.proto ./resources/protobuf/tron.proto",
1919
"gen-protobufts": "pbts -o ./resources/protobuf/tron.d.ts ./resources/protobuf/tron.js"
2020
},

modules/utxo-core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"lint": "eslint --quiet .",
2828
"prepare": "npm run build",
2929
"test": "npm run unit-test",
30-
"unit-test": "mocha --recursive test/"
30+
"unit-test": "mocha --recursive \"dist/test/**/*.js\""
3131
},
3232
"author": "BitGo SDK Team <[email protected]>",
3333
"license": "MIT",
@@ -45,6 +45,7 @@
4545
"publishConfig": {
4646
"access": "public"
4747
},
48+
"type": "commonjs",
4849
"nyc": {
4950
"extension": [
5051
".ts"

modules/utxo-core/test/descriptor/psbt/psbt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function normalize(v: unknown): unknown {
4545
}
4646

4747
async function assertEqualsFixture(t: string, filename: string, value: unknown) {
48-
filename = __dirname + '/fixtures/' + t + '.' + filename;
48+
filename = __dirname + '/../../../../test/descriptor/psbt/fixtures/' + t + '.' + filename;
4949
const nv = normalize(value);
5050
assert.deepStrictEqual(nv, await getFixture(filename, nv));
5151
}

modules/utxo-staking/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lint": "eslint --quiet .",
1616
"prepare": "npm run build",
1717
"coverage": "nyc -- npm run unit-test",
18-
"unit-test": "mocha --recursive test"
18+
"unit-test": "mocha --recursive \"dist/test/**/*.js\""
1919
},
2020
"author": "BitGo SDK Team <[email protected]>",
2121
"license": "MIT",
@@ -41,6 +41,7 @@
4141
".ts"
4242
]
4343
},
44+
"type": "commonjs",
4445
"dependencies": {
4546
"@babylonlabs-io/babylon-proto-ts": "1.0.0",
4647
"@bitgo/babylonlabs-io-btc-staking-ts": "^2.4.0",

modules/utxo-staking/test/unit/babylon/bug71.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('btc-staking-ts bug #71', function () {
1010
let buf: Buffer;
1111
before('load half-signed transaction', async function () {
1212
const fixture = JSON.parse(
13-
await fs.promises.readFile(__dirname + '/../../fixtures/babylon/txTree.testnet.json', 'utf-8')
13+
await fs.promises.readFile(__dirname + '/../../../../test/fixtures/babylon/txTree.testnet.json', 'utf-8')
1414
);
1515
const base64 = fixture.slashingSignedBase64;
1616
assert(typeof base64 === 'string');

modules/utxo-staking/test/unit/babylon/undelegation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type BtcDelegation = t.TypeOf<typeof BtcDelegation>;
2828
async function getFixture(txid: string): Promise<BtcDelegation> {
2929
// As returned by https://babylon.nodes.guru/api#/Query/BTCDelegation
3030
const BtcDelegationResponse = t.type({ btc_delegation: BtcDelegation }, 'BtcDelegationResponse');
31-
const filename = __dirname + `/../../fixtures/babylon/rpc/btc_delegation/testnet.${txid}.json`;
31+
const filename = __dirname + `/../../../../test/fixtures/babylon/rpc/btc_delegation/testnet.${txid}.json`;
3232
const data = JSON.parse(await fs.readFile(filename, 'utf8'));
3333
const result = BtcDelegationResponse.decode(data);
3434
if (isLeft(result)) {

0 commit comments

Comments
 (0)