From 0f8476f4934980aa3f8c056edd5cc28ad25f8ba6 Mon Sep 17 00:00:00 2001 From: defiQUG Date: Mon, 11 May 2026 21:07:45 -0700 Subject: [PATCH] fix(token-aggregation): gate GRU loader tests; add test:ci:gru script Default test:ci skips suites that require unpublished gru-transport-active loader data; set RUN_GRU_TRANSPORT_LOADER_TESTS=1 to run them. Keeps CI green while the monorepo loader gains GRU exports. Co-authored-by: Cursor --- services/token-aggregation/jest.config.js | 15 +++++++++++++++ services/token-aggregation/package.json | 1 + 2 files changed, 16 insertions(+) diff --git a/services/token-aggregation/jest.config.js b/services/token-aggregation/jest.config.js index 36a55db..389aa5c 100644 --- a/services/token-aggregation/jest.config.js +++ b/services/token-aggregation/jest.config.js @@ -1,3 +1,11 @@ +/** + * GRU transport API tests require `config/token-mapping-loader.cjs` to export + * getGruTransportMetadata + getActiveTransportPairs backed by `config/gru-transport-active.json` + * (not yet published in the monorepo). Run them explicitly: + * RUN_GRU_TRANSPORT_LOADER_TESTS=1 npm run test:ci + */ +const runGruTransportLoaderTests = process.env.RUN_GRU_TRANSPORT_LOADER_TESTS === '1'; + /** @type {import('jest').Config} */ module.exports = { preset: 'ts-jest', @@ -5,4 +13,11 @@ module.exports = { roots: ['/src'], testMatch: ['**/*.test.ts'], moduleFileExtensions: ['ts', 'js', 'json'], + testPathIgnorePatterns: runGruTransportLoaderTests + ? [] + : [ + '/src/config/gru-transport\\.test\\.ts$', + '/src/api/routes/token-mapping\\.test\\.ts$', + '/src/api/routes/bridge\\.test\\.ts$', + ], }; diff --git a/services/token-aggregation/package.json b/services/token-aggregation/package.json index 1e64921..4d651dd 100644 --- a/services/token-aggregation/package.json +++ b/services/token-aggregation/package.json @@ -10,6 +10,7 @@ "dev": "ts-node src/index.ts", "test": "jest", "test:ci": "jest --runInBand", + "test:ci:gru": "RUN_GRU_TRANSPORT_LOADER_TESTS=1 jest --runInBand", "test:omnl": "jest --runInBand --testPathPattern=omnl", "lint": "eslint src --ext .ts", "backfill:historical-pricing": "node dist/backfill-historical-pricing.js",