mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-23 02:55:13 -04:00
217bc180ac
History labels compare GitOrigin-RevId: bd06223344e391ba8e6017ebb27bdc3920cf754c
34 lines
935 B
JavaScript
34 lines
935 B
JavaScript
/* eslint-disable
|
|
no-undef,
|
|
max-len,
|
|
*/
|
|
// Set up requirejs to load the tests and mocked dependencies
|
|
// For tests, uses heuristic that test filenames end with Tests.js (existing
|
|
// frontend code) or _tests.js (newer frontend code)
|
|
// For mocks, uses heuristic that loads any .js file within the mocks subfolder
|
|
const testDeps = []
|
|
for (let file in window.__karma__.files) {
|
|
if (window.__karma__.files.hasOwnProperty(file)) {
|
|
if (
|
|
/test\/unit_frontend\/js.+(_t|T)ests\.js$/.test(file) ||
|
|
/test\/unit_frontend\/js\/mocks\/.+\.js$/.test(file)
|
|
) {
|
|
testDeps.push(file)
|
|
}
|
|
}
|
|
}
|
|
|
|
requirejs.config({
|
|
baseUrl: '/base/public/js',
|
|
paths: {
|
|
moment: 'libs/moment-2.9.0'
|
|
},
|
|
map: {
|
|
'*': {
|
|
'ide/file-tree/util/fileOperationI18nNames':
|
|
'../../test/unit_frontend/js/mocks/ide/file-tree/util/fileOperationI18nNames'
|
|
}
|
|
},
|
|
deps: testDeps,
|
|
callback: window.__karma__.start
|
|
})
|