Skip to content

Commit

Permalink
small test improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Dec 5, 2024
1 parent 076f34a commit a9aee7a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ const config: JestConfigWithTsJest = {
'/node_modules/',
'<rootDir>/src/__tests__/setup.ts',
'<rootDir>/src/__tests__/utils/'
]
],
// Display test execution in more detail
verbose: true,
// Fail fast if a test fails
bail: 1
};

export default config;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dev": "tsx watch src/index.ts",
"prebuild": "rm -rf dist",
"build": "esbuild src/index.ts --bundle --platform=node --outdir=dist --format=esm --sourcemap --packages=external && cp .env dist/ 2>/dev/null || true",
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --config jest.config.ts --detectOpenHandles",
"test:related": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --config jest.config.ts --bail --findRelatedTests src/__tests__/*.test.ts",
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --config jest.config.ts --detectOpenHandles --maxWorkers=50% --maxConcurrency=7",
"test:related": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --config jest.config.ts --bail --findRelatedTests src/__tests__/*.test.ts --maxWorkers=50% --maxConcurrency=7",
"smoke-test": "node scripts/smoke-test.js",
"smoke-test:precommit": "SMOKE_TEST_PORT=4000 node scripts/smoke-test.js",
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/chain-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Chain Configuration', () => {
it('should return correct finalization threshold for known chains', () => {
expect(getFinalizationThreshold('1')).toBe(25); // Ethereum Mainnet
expect(getFinalizationThreshold('10')).toBe(2); // Optimism
expect(getFinalizationThreshold('8453')).toBe(4); // Base
expect(getFinalizationThreshold('8453')).toBe(2); // Base
});

it('should return default finalization threshold for unknown chains', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/chain-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const chainConfig: ChainConfig = {
// Optimism
'10': 2,
// Base
'8453': 4,
'8453': 2,
},
};

Expand Down

0 comments on commit a9aee7a

Please sign in to comment.