forked from balena-io/balena-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.coffee
46 lines (39 loc) · 1.13 KB
/
karma.conf.coffee
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
karmaConfig = require('resin-config-karma')
packageJSON = require('./package.json')
{ loadEnv } = require('./tests/util')
BROWSER_BUNDLE = 'build/resin-browser.js'
module.exports = (config) ->
loadEnv()
karmaConfig.logLevel = config.LOG_INFO
karmaConfig.sauceLabs =
testName: "#{packageJSON.name} v#{packageJSON.version}"
karmaConfig.client =
captureConsole: true
karmaConfig.plugins.push(require('karma-env-preprocessor'))
karmaConfig.preprocessors['**/*.spec.coffee'] = [ 'browserify', 'env' ]
karmaConfig.browserify.configure = (bundle) ->
bundle.on 'prebundle', ->
bundle.external(BROWSER_BUNDLE)
karmaConfig.client = mocha:
timeout: 5 * 60 * 1000
slow: 10 * 1000
karmaConfig.files = [
BROWSER_BUNDLE,
'tests/**/*.spec.coffee'
]
karmaConfig.browserConsoleLogOptions =
level: 'log'
format: '%b %T: %m'
terminal: true
karmaConfig.envPreprocessor = [
'RESINTEST_API_URL'
'RESINTEST_EMAIL'
'RESINTEST_PASSWORD'
'RESINTEST_USERNAME'
'RESINTEST_PAID_EMAIL'
'RESINTEST_PAID_PASSWORD'
'RESINTEST_REGISTER_EMAIL'
'RESINTEST_REGISTER_PASSWORD'
'RESINTEST_REGISTER_USERNAME'
]
config.set(karmaConfig)