01a229e011c0d84be34e967cf517d35a476c541aJake Feasel/**
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * The contents of this file are subject to the terms of the Common Development and
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Distribution License (the License). You may not use this file except in compliance with the
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * License.
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel *
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * specific language governing permission and limitations under the License.
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel *
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * When distributing Covered Software, include this CDDL Header Notice in each file and include
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Header, with the fields enclosed by brackets [] replaced by your own identifying
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * information: "Portions copyright [year] [name of copyright owner]".
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel *
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Copyright 2015 ForgeRock AS.
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel */
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel/*global require */
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
01a229e011c0d84be34e967cf517d35a476c541aJake Feaselrequire.config({
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel baseUrl: '../www',
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel paths: {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel jquery: "libs/jquery-2.1.1-min",
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel doTimeout: "libs/jquery.ba-dotimeout-1.0-min",
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel underscore: "libs/lodash-2.4.1-min",
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel sinon: "libs/sinon-1.15.4"
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel },
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel shim: {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel underscore: {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel exports: "_"
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel },
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel sinon: {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel exports: "sinon"
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel },
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel doTimeout: {
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel deps: ["jquery"],
d1e25a21be0403ed5f4ea45f589a3956592befd9Jake Feasel exports: "doTimeout"
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel }
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel }
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel});
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
01a229e011c0d84be34e967cf517d35a476c541aJake Feaselrequire([
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel "../test/tests/mocks/systemInit",
75d0e6897931d0d08f4d64dc1420ce03576b49cbJake Feasel "jquery",
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel "underscore",
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel "sinon"
75d0e6897931d0d08f4d64dc1420ce03576b49cbJake Feasel], function (systemInit, $, _, sinon) {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel sinon.FakeXMLHttpRequest.useFilters = true;
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel sinon.FakeXMLHttpRequest.addFilter(function (method, url, async, username, password) {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel return /((\.html)|(\.css)|(\.less)|(\.json))$/.test(url);
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel });
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel var server = sinon.fakeServer.create();
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel server.autoRespond = true;
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel systemInit(server);
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
75d0e6897931d0d08f4d64dc1420ce03576b49cbJake Feasel $("head", document).append("<base href='../www/' />");
75d0e6897931d0d08f4d64dc1420ce03576b49cbJake Feasel
75d0e6897931d0d08f4d64dc1420ce03576b49cbJake Feasel require(['main','../test/run'], function (appMain, run) {
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel run(server);
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel });
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel});