Files
lodestar/packages/api/package.json
Nico Flaig fa898bb319 chore: restructure tests (#7793)
Follow up to https://github.com/ChainSafe/lodestar/pull/7610 with a few
restructuring suggestions, see comments below for detailed changes,
revives constants tests we are no longer running in CI and makes each
package executable separately again, ie. `cd packages/<package-name>`
into `yarn test:unit` works for all packages again.

One major change is that unit tests default should be written with
`mainnet` preset in mind as I noticed that makes a lot more sense for a
bunch of existing tests, eg. we have tests that depend on external
fixtures, like api spec tests for events and those are not compatible
with `minimal` preset. Also there doesn't seem to be much downside in
most cases for unit tests to use `mainnet` preset as it does not run
through all the epoch, like for example a e2e or sim test does. So
overall, it allows us to use mainnet fixtures / more "real world" data
which seems better with little to no downside.


Time comparison running unit tests on `unstable` vs. this branch

**unstable**

![image](https://github.com/user-attachments/assets/ba9c8e68-ec1a-4cb7-90fc-eb00cedae4bf)

**nflaig/restructure-tests**

![image](https://github.com/user-attachments/assets/0ffab5a4-4a71-42e1-a26e-32fc5627b873)

There is just a difference of 2 seconds (might be a fluke) in a 6 minute
run, this seems acceptable to me considering the benefits of using
`mainnet` preset noted above.
2025-05-07 18:21:12 +01:00

96 lines
2.3 KiB
JSON

{
"name": "@lodestar/api",
"description": "A Typescript REST client for the Ethereum Consensus API",
"license": "Apache-2.0",
"author": "ChainSafe Systems",
"homepage": "https://github.com/ChainSafe/lodestar#readme",
"repository": {
"type": "git",
"url": "git+https://github.com:ChainSafe/lodestar.git"
},
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.29.0",
"type": "module",
"exports": {
".": {
"import": "./lib/index.js"
},
"./server": {
"import": "./lib/server/index.js"
},
"./beacon": {
"import": "./lib/beacon/index.js"
},
"./beacon/server": {
"import": "./lib/beacon/server/index.js"
},
"./builder": {
"import": "./lib/builder/index.js"
},
"./builder/server": {
"import": "./lib/builder/server/index.js"
},
"./keymanager": {
"import": "./lib/keymanager/index.js"
},
"./keymanager/server": {
"import": "./lib/keymanager/server/index.js"
}
},
"typesVersions": {
"*": {
"*": [
"*",
"lib/*",
"lib/*/index"
]
}
},
"types": "./lib/index.d.ts",
"files": [
"lib/**/*.d.ts",
"lib/**/*.js",
"lib/**/*.js.map",
"*.d.ts",
"*.js"
],
"scripts": {
"clean": "rm -rf lib && rm -f *.tsbuildinfo",
"build": "tsc -p tsconfig.build.json",
"build:watch": "yarn run build --watch",
"build:release": "yarn clean && yarn run build",
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
"check-types": "tsc",
"lint": "biome check src/ test/",
"lint:fix": "yarn run lint --write",
"test": "yarn test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^1.1.0",
"@chainsafe/ssz": "^1.2.0",
"@lodestar/config": "^1.29.0",
"@lodestar/params": "^1.29.0",
"@lodestar/types": "^1.29.0",
"@lodestar/utils": "^1.29.0",
"eventsource": "^2.0.2",
"qs": "^6.11.1"
},
"devDependencies": {
"@types/eventsource": "^1.1.11",
"@types/qs": "^6.9.7",
"ajv": "^8.12.0",
"fastify": "^5.2.1"
},
"keywords": [
"ethereum",
"eth-consensus",
"beacon",
"api",
"blockchain"
]
}