-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bobanetwork/wsdt/test-configuration
Wsdt/test configuration
- Loading branch information
Showing
11 changed files
with
6,851 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# light-bridge-chains | ||
Chain Configs for Light Bridge | ||
|
||
# Testing | ||
|
||
> Run tests | ||
```yarn test``` | ||
|
||
> Run tests with coverage | ||
> | ||
```yarn test-coverage``` | ||
|
||
<img src="coverage/badge-lines.svg" alt="Line Coverage"> | ||
<br> | ||
<img src="coverage/badge-branches.svg" alt="Branch Coverage"> | ||
<br> | ||
<img src="coverage/badge-functions.svg" alt="Function Coverage"> | ||
<br> | ||
<img src="coverage/badge-statements.svg" alt="Function Coverage"> | ||
<br> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { defaults } = require('jest-config') | ||
|
||
/** @type {import('jest').Config} */ | ||
const config = { | ||
moduleFileExtensions: [ | ||
...defaults.moduleFileExtensions, | ||
'mts', | ||
'cts', | ||
'd.ts', | ||
], | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
transform: { | ||
'node_modules/variables/.+\\.(j|t)sx?$': 'ts-jest', | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!variables/.*)'], | ||
coverageReporters: [ | ||
"json-summary", | ||
"text", | ||
"lcov" | ||
] | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
const {describe, it} = require("node:test"); | ||
const assert = require("node:assert"); | ||
const {getRandomPublicRpc} = require("./chains.ts"); | ||
const {getRandomPublicRpc} = require("../../src/chains.ts"); | ||
|
||
describe("chains", () => { | ||
it("should work", () => { | ||
assert(true) | ||
expect(1).toBe(1) | ||
}); | ||
|
||
it("should get random RPC when only one element", () => { | ||
const randomRPC = getRandomPublicRpc(288) | ||
assert.strictEqual(randomRPC, "https://boba-ethereum.gateway.tenderly.co") | ||
expect(randomRPC).toEqual("https://boba-ethereum.gateway.tenderly.co") | ||
}); | ||
|
||
/** @DEV brittle */ | ||
it("should get random RPC with multiple endpoints & randomized", () => { | ||
let randomRPCs = [getRandomPublicRpc(56), getRandomPublicRpc(56), getRandomPublicRpc(56), getRandomPublicRpc(56)] | ||
const areDifferent = new Set(randomRPCs).size === randomRPCs.length | ||
assert(areDifferent) | ||
expect(areDifferent).toBe(false) | ||
}); | ||
}) |
Oops, something went wrong.