module . exports = function ( config ) { const options = { basePath : '' , frameworks : [ 'jasmine' ] , files : [ 'projects/trivia/src/tests/setup.ts' , 'projects/trivia/src/tests/**/*.ts' ] , exclude : [ ] , preprocessors : { } , reporters : [ 'dots' ] , port : 9876 , colors : true , logLevel : config . LOG_INFO , autoWatch : true , browsers : [ ] , customLaunchers : { android : { base : 'NS' , platform : 'android' } , ios : { base : 'NS' , platform : 'ios' } , ios_simulator : { base : 'NS' , platform : 'ios' , arguments : [ '--emulator' ] } } , singleRun : false } ; setWebpackPreprocessor ( config , options ) ; setWebpack ( config , options ) ; config . set ( options ) ; } ; function setWebpackPreprocessor ( config , options ) { if ( config && config . bundle ) { if ( ! options . preprocessors ) { options . preprocessors = { } ; } options . files . forEach ( file => { if ( ! options . preprocessors [ file ] ) { options . preprocessors [ file ] = [ ] ; } options . preprocessors [ file ] . push ( 'webpack' ) ; } ) ; } } function setWebpack ( config , options ) { if ( config && config . bundle ) { const env = { } ; env [ config . platform ] = true ; env . sourceMap = config . debugBrk ; env . appPath = config . appPath ; env . project = "trivia" ; options . webpack = require ( './webpack.config' ) ( env ) ; delete options . webpack . entry ; delete options . webpack . output . libraryTarget ; const invalidPluginsForUnitTesting = [ "GenerateBundleStarterPlugin" , "GenerateNativeScriptEntryPointsPlugin" ] ; options . webpack . plugins = options . webpack . plugins . filter ( p => ! invalidPluginsForUnitTesting . includes ( p . constructor . name ) ) ; } }