Skip to content

Commit

Permalink
fix jest warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Mar 4, 2024
1 parent 8589dae commit b7fa772
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 80 deletions.
14 changes: 7 additions & 7 deletions packages/web3-core/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
},
verbose: false,
collectCoverage: false,
coverageReporters: ['json'],
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-eth-abi/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-eth-contract/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-eth-personal/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-net/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-providers-ipc/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-types/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
verbose: false,
collectCoverage: false,
Expand Down
14 changes: 7 additions & 7 deletions packages/web3-utils/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
},
verbose: false,
collectCoverage: false,
coverageReporters: ['json'],
Expand Down
12 changes: 6 additions & 6 deletions packages/web3-validator/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
7 changes: 6 additions & 1 deletion packages/web3/test/cjs_black_box/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ module.exports = {
},
},
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
};
12 changes: 6 additions & 6 deletions packages/web3/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
Expand Down
7 changes: 6 additions & 1 deletion packages/web3/test/esm_black_box/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export default {
},
},
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
};
17 changes: 7 additions & 10 deletions templates/jest.config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,20 @@ You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
verbose: false,
collectCoverage: false,
coverageReporters: ['json'],
Expand Down
12 changes: 6 additions & 6 deletions tools/web3-plugin-example/test/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
rootDir: '../..',
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/config/setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
},
],
},
verbose: false,
collectCoverage: false,
Expand Down

1 comment on commit b7fa772

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: b7fa772 Previous: 6c075db Ratio
processingTx 9204 ops/sec (±4.16%) 9301 ops/sec (±4.81%) 1.01
processingContractDeploy 43638 ops/sec (±6.27%) 39129 ops/sec (±7.62%) 0.90
processingContractMethodSend 20640 ops/sec (±6.72%) 19443 ops/sec (±5.19%) 0.94
processingContractMethodCall 41198 ops/sec (±5.94%) 38971 ops/sec (±6.34%) 0.95
abiEncode 46184 ops/sec (±7.98%) 44252 ops/sec (±6.92%) 0.96
abiDecode 33358 ops/sec (±6.87%) 30419 ops/sec (±8.89%) 0.91
sign 1690 ops/sec (±0.84%) 1656 ops/sec (±4.08%) 0.98
verify 370 ops/sec (±2.72%) 373 ops/sec (±0.78%) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.