web/test/rolldown.config.mjs32 lines · 1228 bytes
| 1 | // Bundles the self-tests for Node. The live-mode test reads a fixed fake deployment (test/fixtures/chain-data.json, |
| 2 | // written by scripts/sync-sepolia-data.mjs from test/fixtures/deployment.json) instead of the shipped |
| 3 | // src/chain-data-sepolia.json, which may still be a placeholder. The offline test uses the shipped recording. |
| 4 | import { fileURLToPath } from 'node:url' |
| 5 | |
| 6 | const fixture = fileURLToPath(new URL('./fixtures/chain-data.json', import.meta.url)) |
| 7 | const swapDeployment = { |
| 8 | name: 'swap-deployment', |
| 9 | resolveId(source) { |
| 10 | return source.endsWith('/chain-data-sepolia.json') ? fixture : null |
| 11 | }, |
| 12 | } |
| 13 | |
| 14 | export default [ |
| 15 | { |
| 16 | input: 'test/airlock-selftest.ts', |
| 17 | platform: 'node', |
| 18 | plugins: [swapDeployment], |
| 19 | output: { file: 'node_modules/.cache/airlock-selftest.mjs', format: 'esm' }, |
| 20 | }, |
| 21 | { |
| 22 | input: 'test/offline-selftest.ts', |
| 23 | platform: 'node', |
| 24 | output: { file: 'node_modules/.cache/offline-selftest.mjs', format: 'esm' }, |
| 25 | }, |
| 26 | { |
| 27 | // the operator backend (operator/, functions/) against a fake Sepolia; reads the shipped deployment data |
| 28 | input: 'test/operator-selftest.ts', |
| 29 | platform: 'node', |
| 30 | output: { file: 'node_modules/.cache/operator-selftest.mjs', format: 'esm' }, |
| 31 | }, |
| 32 | ] |