overleaf/services/web/test/unit_frontend/coffee/test-main.coffee
Alasdair Smith 89c9475d29 Configure karma to load angular, requirejs and test/source files
Use test-main.js file to configure requirejs so that AMD loader can be
used
2018-02-20 14:01:02 +00:00

14 lines
380 B
CoffeeScript

# Set up requirejs to load the tests
# Uses heuristic that test filenames end with Tests.js
tests = []
for file of window.__karma__.files
if window.__karma__.files.hasOwnProperty(file)
if /Tests\.js$/.test(file)
tests.push(file)
requirejs.config
baseUrl: '/base/public/js'
paths:
"moment": "libs/moment-2.9.0"
deps: tests
callback: window.__karma__.start