1
- // Karma configuration
1
+ var webpack = require ( 'webpack' ) ;
2
+ var webpackConfigCreator = require ( './webpack.config' ) ;
3
+ var webpackConfig = webpackConfigCreator ( { buildType : "dev" } ) ;
2
4
3
- module . exports = function ( config ) {
5
+ module . exports = function ( config ) {
4
6
config . set ( {
5
-
6
- // base path that will be used to resolve all patterns (eg. files, exclude)
7
7
basePath : '' ,
8
-
9
- // frameworks to use
10
- // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
11
8
frameworks : [ 'qunit' ] ,
12
-
13
- // list of files / patterns to load in the browser
14
9
files : [
15
- "wwwroot/js/qunit.css" ,
16
- "wwwroot/js/knockout.js" ,
17
- "wwwroot/js/survey.ko.js" ,
18
- "wwwroot/js/surveyeditor.js" ,
19
-
20
- "wwwroot/tests/surveyeditor.tests.js" ,
21
- ] ,
22
-
23
- // list of files to exclude
10
+ 'tests/entries/*.ts'
11
+ ] ,
24
12
exclude : [
25
13
] ,
26
-
27
- // preprocess matching files before serving them to the browser
28
- // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
29
- preprocessors : {
30
- 'wwwroot/js/surveyeditor.js' : [ 'coverage' ]
14
+ mime : {
15
+ 'text/x-typescript' : [ 'ts' , 'tsx' ]
31
16
} ,
32
-
33
- // test results reporter to use
34
- // possible values: 'dots', 'progress'
35
- // available reporters: https://npmjs.org/browse/keyword/karma-reporter
36
- reporters : [ 'progress' , 'dots' , 'junit' , 'coverage' ] ,
37
-
38
17
junitReporter : {
39
- outputDir : 'shippable /testresults/' ,
18
+ outputDir : 'tmp /testresults/' ,
40
19
outputFile : 'test-results.xml'
41
20
} ,
42
-
43
- coverageReporter : {
44
- type : 'cobertura' ,
45
- dir : 'shippable/codecoverage/'
21
+ preprocessors : {
22
+ '**/*.ts' : [ 'webpack' , 'sourcemap' ]
46
23
} ,
47
-
48
- // web server port
49
- port : 9876 ,
50
-
51
- // enable / disable colors in the output (reporters and logs)
24
+ webpack : {
25
+ module : webpackConfig . module ,
26
+ resolve : webpackConfig . resolve ,
27
+ plugins : [
28
+ new webpack . SourceMapDevToolPlugin ( {
29
+ filename : null , // if no value is provided the sourcemap is inlined
30
+ test : / \. ( t s | j s ) ( $ | \? ) / i // process .js and .ts files only
31
+ } )
32
+ ]
33
+ } ,
34
+ reporters : [ 'progress' , 'dots' , 'junit' ] ,
35
+ browsers : [ 'PhantomJS' ] ,
52
36
colors : true ,
53
-
54
- // level of logging
55
37
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
56
- logLevel : config . LOG_INFO ,
57
-
58
- // enable / disable watching file and executing tests whenever any file changes
59
- autoWatch : false ,
60
-
61
- // start these browsers
62
- // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63
- browsers : [ 'PhantomJS' ] ,
64
-
65
- // Continuous Integration mode
66
- // if true, Karma captures browsers, runs the tests and exits
67
- singleRun : true
38
+ logLevel : config . LOG_WARN ,
39
+ autoWatch : true ,
40
+ singleRun : false ,
41
+ concurrency : Infinity
68
42
} )
69
- }
43
+ } ;
0 commit comments