forked from aws/aws-encryption-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
104 lines (100 loc) · 2.72 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Karma configuration
module.exports = function (config) {
process.on('infrastructure_error', (error) => {
/* @aws-sdk/karma-credential-loader get credential
* as configured by the AWS SDK.
* These credentials are used to test KMS integration
* with the Encryption SDK.
* If they do not exist, then karma will exit with an `UnhandledRejection`.
* The following will log errors link this,
* but still let the karma-server shut down.
*/
console.error('infrastructure_error', error);
})
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'modules/*-browser/test/**/*.ts',
'modules/web-crypto-backend/test/**/*.ts',
],
preprocessors: {
'modules/*-browser/test/**/*.ts': ['webpack', 'credentials'],
'modules/web-crypto-backend/test/**/*.ts': ['webpack', 'credentials'],
},
webpack: {
resolve: {
extensions: [ '.ts', '.js' ]
},
mode: 'development',
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
logInfoToStdOut: true,
projectReferences: true,
configFile: `${__dirname}/tsconfig.module.json`
}
}
],
exclude: /node_modules/,
},
{
test: /\.ts$/,
exclude: [ /\/test\// ],
enforce: 'post',
use: {
loader: 'istanbul-instrumenter-loader',
options: { esModules: true }
}
}
]
},
stats: {
colors: true,
modules: true,
reasons: true,
errorDetails: true
},
devtool: 'inline-source-map',
node: {
fs: 'empty'
}
},
coverageIstanbulReporter: {
reports: [ 'json' ],
dir: '.karma_output',
fixWebpackSourcePaths: true
},
plugins: [
'@aws-sdk/karma-credential-loader',
'karma-chrome-launcher',
'karma-mocha',
'karma-chai',
'karma-webpack',
'karma-coverage-istanbul-reporter',
'karma-json-fixtures-preprocessor'
],
reporters: ['progress', 'coverage-istanbul'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeHeadlessDisableCors'],
customLaunchers: {
ChromeHeadlessDisableCors: {
base: 'ChromeHeadless',
flags: ['--disable-web-security', '--no-sandbox']
}
},
singleRun: true,
concurrency: Infinity,
exclude: ['**/*.d.ts']
})
}