Makefile, Dockerfile, CI workflow, prettier config, manifests for Chrome (MV3) and Firefox (MV2), source directory structure, and minimal test suite. All checks pass.
This commit is contained in:
29
tests/constants.test.js
Normal file
29
tests/constants.test.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const {
|
||||
ETHEREUM_MAINNET_CHAIN_ID,
|
||||
DEFAULT_RPC_URL,
|
||||
BIP44_ETH_PATH,
|
||||
ERC20_ABI,
|
||||
} = require("../src/shared/constants");
|
||||
|
||||
describe("constants", () => {
|
||||
test("exports expected chain ID", () => {
|
||||
expect(ETHEREUM_MAINNET_CHAIN_ID).toBe("0x1");
|
||||
});
|
||||
|
||||
test("exports a default RPC URL", () => {
|
||||
expect(typeof DEFAULT_RPC_URL).toBe("string");
|
||||
expect(DEFAULT_RPC_URL.startsWith("https://")).toBe(true);
|
||||
});
|
||||
|
||||
test("exports BIP-44 Ethereum derivation path", () => {
|
||||
expect(BIP44_ETH_PATH).toBe("m/44'/60'/0'/0");
|
||||
});
|
||||
|
||||
test("exports ERC-20 ABI with expected functions", () => {
|
||||
expect(Array.isArray(ERC20_ABI)).toBe(true);
|
||||
expect(ERC20_ABI.length).toBeGreaterThan(0);
|
||||
const joined = ERC20_ABI.join(" ");
|
||||
expect(joined).toContain("balanceOf");
|
||||
expect(joined).toContain("transfer");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user