Skip to content

Commit 7d4c34c

Browse files
committed
fix-issue-236: fix TypeError when initialize a Worker in jsdome env by upgrade dependency and update ci task,remove node14 job
1 parent cbe6dcb commit 7d4c34c

File tree

4 files changed

+193
-185
lines changed

4 files changed

+193
-185
lines changed

.github/workflows/tests-sandbox.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
platform: [ubuntu-latest, macos-latest]
12-
node-version: [14, 16]
12+
node-version: [16]
1313
runs-on: ${{ matrix.platform }}
1414
steps:
1515
- uses: actions/checkout@v2
@@ -19,4 +19,4 @@ jobs:
1919
- name: Install dependencies
2020
run: yarn
2121
- name: Run tests
22-
run: yarn test:sandbox:ci --fail-fast
22+
run: NODE_OPTIONS=--max-old-space-size=4096 yarn test:sandbox:ci --fail-fast

__tests__/05.spoon-contract-to-sandbox.ava.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@ test.afterEach.always(async t => {
4545
test('using `withData` for contracts > 50kB fails', async t => {
4646
const root = t.context.worker.rootAccount;
4747

48-
t.regex(
49-
await captureError(async () => {
50-
await root.importContract({
51-
mainnetContract: REF_FINANCE_ACCOUNT,
52-
withData: true,
53-
blockId: 50_000_000,
54-
});
55-
}),
56-
new RegExp(`State of contract ${REF_FINANCE_ACCOUNT} is too large to be viewed`),
57-
);
48+
const error_response = await captureError(async () => {
49+
await root.importContract({
50+
mainnetContract: REF_FINANCE_ACCOUNT,
51+
withData: true,
52+
blockId: 50_000_000,
53+
});
54+
});
55+
const check = error_response.includes('is larger than allowed') || error_response.includes('is too large to be viewed');
56+
t.assert(check);
5857
});
5958

6059
test('if skipping `withData`, fetches only contract Wasm bytes', async t => {

packages/js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"callsites": "^4.0.0",
2323
"fs-extra": "^10.0.0",
2424
"js-sha256": "^0.9.0",
25-
"near-api-js": "^v2.1.4",
25+
"near-api-js": "^v3.0.3",
2626
"near-sandbox": "^0.0.17",
2727
"near-units": "^0.1.9",
2828
"node-port-check": "^2.0.1",

0 commit comments

Comments
 (0)