Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit c51566b

Browse files
author
Noel
authored
Jest v26 (#365)
* fix: config cross-fetch, jest-jest-fetch-mock * build: jest, ts-jest v26 * chore: tsConfig -> tsconfig
1 parent 8887821 commit c51566b

File tree

6 files changed

+1921
-1192
lines changed

6 files changed

+1921
-1192
lines changed

jest-setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
//
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
1718
require('jest-fetch-mock').enableMocks();

jest.build.config.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ const config = {
3030
'^@zilliqa-js/zilliqa': '<rootDir>/packages/zilliqa/src/index.ts',
3131
'^@zilliqa-js/proto$': '<rootDir>/packages/zilliqa-js-proto/dist/index.js',
3232
'^@zilliqa-js/(.*)$': '<rootDir>/packages/zilliqa-js-$1/src/index.ts',
33-
'cross-fetch': 'jest-fetch-mock',
3433
},
3534
globals: {
3635
'ts-jest': {
37-
tsConfig: './tsconfig.test.json',
36+
tsconfig: './tsconfig.test.json',
3837
},
3938
},
4039
testURL: 'http://localhost',
@@ -43,6 +42,8 @@ const config = {
4342
'<rootDir>/packages/*/src/**/*.{ts,js}',
4443
'!**/node_modules/**',
4544
],
45+
automock: false,
46+
resetMocks: false,
4647
setupFiles: ['<rootDir>/jest-setup.js'],
4748
};
4849

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@types/bn.js": "^4.11.3",
3434
"@types/camelcase": "^4.1.0",
3535
"@types/fancy-log": "^1.3.0",
36-
"@types/jest": "^23.3.1",
36+
"@types/jest": "26.0.13",
3737
"@types/node": "^16.6.1",
3838
"@types/uuid": "^3.4.4",
3939
"@types/webpack": "^4.4.17",
@@ -44,7 +44,7 @@
4444
"eslint": "^7.31.0",
4545
"fancy-log": "^1.3.2",
4646
"husky": "^7.0.1",
47-
"jest": "^23.4.2",
47+
"jest": "26.6.3",
4848
"jest-fetch-mock": "3.0.3",
4949
"lerna": "^3.18.1",
5050
"prettier": "^2.3.2",
@@ -56,7 +56,7 @@
5656
"rollup-plugin-node-globals": "^1.4.0",
5757
"rollup-plugin-node-resolve": "^3.4.0",
5858
"rollup-plugin-typescript2": "0.17.1",
59-
"ts-jest": "^23.1.3",
59+
"ts-jest": "26.5.5",
6060
"ts-loader": "8.0.4",
6161
"ts-node": "^7.0.1",
6262
"tslib": "^2.3.0",

packages/zilliqa-js-core/src/net.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
//
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
18-
import fetch from 'cross-fetch';
19-
// import { validation } from '@zilliqa-js/util';
17+
import 'cross-fetch/polyfill';
2018
import { WithRequest } from './util';
2119

2220
/**

0 commit comments

Comments
 (0)