UNPKG

712 Btext/coffeescriptView Raw
1allTestFiles = []
2TEST_REGEXP = /(spec|test)(\.coffee)?(\.js)?$/i
3
4# Get a list of all the test files to include
5Object.keys(window.__karma__.files).forEach (file) ->
6
7 if TEST_REGEXP.test(file)
8 # Normalize paths to RequireJS module names.
9 # If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
10 # then do not normalize the paths
11 allTestFiles.push file.replace(/^\/base\/|\.js$/g, '')
12 return
13
14require.config
15 # Karma serves files under /base, which is the basePath from your config file
16 baseUrl: "/base"
17
18 # dynamically load all test files
19 deps: allTestFiles
20
21 # we have to kickoff jasmine, as it is asynchronous
22 callback: window.__karma__.start