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