Files
2025-11-30 08:35:03 +02:00

40 lines
1.2 KiB
JavaScript

const path = require('path');
const { LOG_DEBUG } = require( 'karma/lib/constants' );
module.exports = function ( config ) {
// allows tests on specific files
const specFiles = config.specs ? config.specs : './tests/specs/**/*.js';
config.set( {
frameworks: [ 'mocha', 'chai' ],
files: [
{ pattern: "./node_modules/three/build/three.module.js", type: "module" },
{ pattern: "./build/three-mesh-ui.module.js", watched: true, type: "module" },
{ pattern: './examples/assets/**', included: false, served: true },
{ pattern: specFiles, watched: true, type: "module" },
{ pattern: './tests/utils/**/*.js', watched: true, included: false },
],
basePath: "../",
reporters: [ 'mocha', 'coverage-istanbul' ],
preprocessors: {
"./build/**/*.js": ["karma-coverage-istanbul-instrumenter"],
"./src/**/*.js": ["karma-coverage-istanbul-instrumenter"],
},
coverageIstanbulInstrumenter: {
esModules: true
},
coverageIstanbulReporter: {
reports: [ "text" ],
},
port: 9876, // karma web server port
colors: true,
// logLevel: config.LOG,
browsers: [ 'Chrome', 'ChromeHeadless' ],
autoWatch: true,
concurrency: Infinity
} );
};