Source mirror · commit 369512f · 2026-10-26 · MIT · canonical repo: gitlab.com/jiapunk/upgrade-airlock
git clone https://upgrade-airlock.pages.dev/source/upgrade-airlock.git
upgrade-airlock / web / test / rolldown.config.mjs
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.
4import { fileURLToPath } from 'node:url'
5
6const fixture = fileURLToPath(new URL('./fixtures/chain-data.json', import.meta.url))
7const swapDeployment = {
8 name: 'swap-deployment',
9 resolveId(source) {
10 return source.endsWith('/chain-data-sepolia.json') ? fixture : null
11 },
12}
13
14export 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]