requirejs.config.tpl.coffee 712 B

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