1 | // Karma configuration
|
2 | // Generated on Tue Aug 11 2020 16:34:20 GMT-0700 (Pacific Daylight Time)
|
3 | if (!process.env.CHROME_BIN) {
|
4 | process.env.CHROME_BIN = require('puppeteer').executablePath();
|
5 | }
|
6 |
|
7 | module.exports = function (config) {
|
8 | config.set({
|
9 |
|
10 | // base path that will be used to resolve all patterns (eg. files, exclude)
|
11 | basePath: '',
|
12 |
|
13 |
|
14 | // frameworks to use
|
15 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
16 | frameworks: ['jasmine', 'karma-typescript'],
|
17 |
|
18 |
|
19 | // list of files / patterns to load in the browser
|
20 | files: [
|
21 | 'dist/browser/BitGoJS.min.js',
|
22 | 'test/browser/karmaHelper.js',
|
23 | { pattern: 'test/browser/**/*.ts' },
|
24 | ],
|
25 |
|
26 | plugins: [
|
27 | require('karma-jasmine'),
|
28 | require('karma-typescript'),
|
29 | require('karma-chrome-launcher'),
|
30 | ],
|
31 | // list of files / patterns to exclude
|
32 | exclude: [
|
33 | 'node_modules',
|
34 | ],
|
35 |
|
36 |
|
37 | // preprocess matching files before serving them to the browser
|
38 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
39 | preprocessors: {
|
40 | 'test/browser/**/*.ts': ['karma-typescript'],
|
41 | },
|
42 | karmaTypescriptConfig: {
|
43 | bundlerOptions: {
|
44 | entrypoints: /\.spec\.ts$/,
|
45 | },
|
46 | compilerOptions: {
|
47 | sourceMap: true,
|
48 | target: 'es6',
|
49 | lib: [
|
50 | 'dom',
|
51 | 'es6',
|
52 | 'es5',
|
53 | 'es2017',
|
54 | 'es2018',
|
55 | ],
|
56 | types: ['jasmine'],
|
57 | },
|
58 | include: ['test/browser/**/*.ts'],
|
59 | },
|
60 |
|
61 | // test results reporter to use
|
62 | // possible values: 'dots', 'progress'
|
63 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
64 | reporters: ['progress'],
|
65 |
|
66 |
|
67 | // web server port
|
68 | port: 9876,
|
69 |
|
70 |
|
71 | // enable / disable colors in the output (reporters and logs)
|
72 | colors: true,
|
73 |
|
74 |
|
75 | // level of logging
|
76 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
77 | logLevel: config.LOG_INFO,
|
78 |
|
79 |
|
80 | // enable / disable watching file and executing tests whenever any file changes
|
81 | autoWatch: true,
|
82 |
|
83 |
|
84 | // start these browsers
|
85 | browsers: ['HeadlessChromeNoSandbox'],
|
86 | customLaunchers: {
|
87 | HeadlessChromeNoSandbox: {
|
88 | base: 'ChromeHeadless',
|
89 | flags: ['--no-sandbox'],
|
90 | },
|
91 | },
|
92 |
|
93 | // Continuous Integration mode
|
94 | // if true, Karma captures browsers, runs the tests and exits
|
95 | singleRun: true,
|
96 | // uncomment to debug locally
|
97 | // browsers: ['Chrome'],
|
98 | // singleRun: false
|
99 | });
|
100 | };
|