test-main.js revision fc702bf2012c354e5a405223dc906b0b7818dee6
2266N/A/**
2266N/A * The contents of this file are subject to the terms of the Common Development and
2266N/A * Distribution License (the License). You may not use this file except in compliance with the
2266N/A * License.
2266N/A *
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
*/
(function () {
var TEST_REGEXP = /(spec|test)\.js$/i,
allTestFiles = Object.keys(window.__karma__.files).filter(function (file) {
return TEST_REGEXP.test(file);
});
require.config({
baseUrl: "/base/target/compiled",
map: {
"*": {
// TODO: Remove this when there are no longer any references to the "underscore" dependency
"underscore": "lodash"
}
},
paths: {
chai: "/base/node_modules/chai/chai",
handlebars: "/base/target/dependencies/libs/handlebars-4.0.5",
i18next: "/base/target/dependencies/libs/i18next-1.7.3-min",
jquery: "/base/target/dependencies/libs/jquery-2.1.1-min",
lodash: "/base/target/dependencies/libs/lodash-3.10.1-min",
sinon: "/base/target/test-classes/libs/sinon-1.15.4",
"sinon-chai": "/base/node_modules/sinon-chai/lib/sinon-chai",
squire: "/base/target/test-classes/libs/squire-0.2.0"
},
shim: {
"i18next": {
deps: ["jquery", "handlebars"],
exports: "i18n"
},
"lodash": {
exports: "_"
}
}
});
require(["chai", "i18next", "sinon-chai"].concat(allTestFiles), function (chai, i18next, chaiSinon) {
chai.use(chaiSinon);
i18next.init({
resGetPath: require.toUrl("locales/__lng__/__ns__.json")
});
window.expect = chai.expect;
window.__karma__.start();
});
}());