|
| 1 | +/** |
| 2 | + * Copyright 2026 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +const path = require('path'); |
| 18 | + |
| 19 | +module.exports = function (config) { |
| 20 | + config.set({ |
| 21 | + basePath: '', |
| 22 | + frameworks: ['jasmine'], |
| 23 | + plugins: [require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-esbuild')], |
| 24 | + files: [{pattern: 'tests/**/*.test.ts', watched: true}], |
| 25 | + preprocessors: { |
| 26 | + 'tests/**/*.test.ts': ['esbuild'], |
| 27 | + }, |
| 28 | + esbuild: { |
| 29 | + tsconfig: './tsconfig.json', |
| 30 | + target: 'es2022', |
| 31 | + format: 'iife', |
| 32 | + sourcemap: true, |
| 33 | + alias: { |
| 34 | + // Map @a2ui/lit packages directly to their TypeScript source files. |
| 35 | + // This allows tests to run against live code changes without requiring |
| 36 | + // a rebuild step first. |
| 37 | + '@a2ui/lit/v0_9': path.resolve(__dirname, '../src/v0_9/index.ts'), |
| 38 | + '@a2ui/lit': path.resolve(__dirname, '../src/index.ts'), |
| 39 | + }, |
| 40 | + }, |
| 41 | + reporters: ['progress'], |
| 42 | + port: 9876, |
| 43 | + colors: true, |
| 44 | + logLevel: config.LOG_INFO, |
| 45 | + autoWatch: false, |
| 46 | + browsers: ['ChromeHeadless'], |
| 47 | + singleRun: true, |
| 48 | + concurrency: Infinity, |
| 49 | + hostname: '127.0.0.1', |
| 50 | + listenAddress: '127.0.0.1', |
| 51 | + captureTimeout: 210000, |
| 52 | + browserNoActivityTimeout: 210000, |
| 53 | + browserDisconnectTimeout: 10000, |
| 54 | + browserDisconnectTolerance: 3, |
| 55 | + }); |
| 56 | +}; |
0 commit comments