Skip to content

Commit aed5339

Browse files
authored
Merge pull request #238 from fospring/fix-issue-236/fix-unexpected-type-when-init-worker
fix-issue-236: fix TypeError when initialize a Worker in jsdome env…
2 parents cbe6dcb + ef5e434 commit aed5339

File tree

6 files changed

+2346
-2052
lines changed

6 files changed

+2346
-2052
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: yarn test:sandbox:ci-with-ignore --fail-fast

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,15 +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`),
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+
t.assert(
56+
error_response.includes('is larger than allowed') || error_response.includes('is too large to be viewed'),
5757
);
5858
});
5959

File renamed without changes.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"test:testnet:ci": "yarn build && TESTNET_MASTER_ACCOUNT_ID='ro3evqruqecmi7q4uwux1651245117258' ava --config ./ava.testnet.config.cjs",
1515
"test:sandbox": "yarn test:sandbox:ci --verbose",
1616
"test:sandbox:ci": "yarn build && ava",
17+
"test:sandbox:ci-with-ignore": "yarn build && ava __tests__/0* && cd examples/simple-project/ && ava && cd ../../packages/js && ava",
1718
"test": "yarn test:sandbox && yarn test:testnet",
1819
"prepare": "husky install",
1920
"release": "yarn lerna publish",

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)