-
Notifications
You must be signed in to change notification settings - Fork 10
/
karma.conf.js
69 lines (67 loc) · 1.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
const path = require('path');
const webpack = require('webpack');
const dotenv = require('dotenv-webpack')
const packageJson = require('./package.json');
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'chai', 'sinon-chai', 'chai-as-promised'],
autoWatch: true,
browsers: ['ChromeHeadless'],
files: [
{pattern: 'scripts/register-assert.js', included: false},
'src/__tests__/index.ts',
],
colors: true,
reporters: ['progress'],
logLevel: config.LOG_INFO,
browserNoActivityTimeout: 60 * 1000,
captureTimeout: 60000,
singleRun: true,
mime: {
'text/x-typescript': ['ts'],
'application/wasm': ['wasm'],
},
preprocessors: {
'src/__tests__/index.ts': ['webpack'],
},
webpack: {
output: {
path: '/test',
},
mode: 'development',
resolve: {
extensions: ['.js', '.ts'],
fallback: {
fs: false,
net: false,
tls: false
},
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
},
{
test: /\.wasm$/,
type: "asset/inline",
},
],
},
experiments: {
asyncWebAssembly: true,
},
plugins: [
new dotenv({
browser: JSON.stringify(true),
VERSION: JSON.stringify(packageJson.version),
API_KEY_PRIVATE_KEY: JSON.stringify(process.env.APP_KEY),
API_KEY_ID: JSON.stringify(process.env.APP_KEY_ID),
APP_ID: JSON.stringify(process.env.APP_ID),
API_URL: JSON.stringify(process.env.API_URL),
}),
],
},
});
};