"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var routeService_1 = require("../../partial-src/service/routeService");
function run() {
    var interval = 500;
    describe("Test route service", function () {
        it("Basic test", function () {
            var service = new routeService_1.RouteService();
            var visited = false;
            service.route("/debug/:id/:name", function (params) {
                if (params.id !== "id" || params.name !== "name") {
                    throw new Error("invalid route service");
                }
                visited = true;
            });
            service.goto("/debug/id/name");
            setTimeout(function () {
                if (!visited)
                    throw new Error("Invalid route service");
                visited = false;
                service.events.once("unhandledUrl", function () {
                    visited = true;
                });
                // fake handle url
                service.handle("/QAQ");
                if (!visited)
                    throw new Error("Invalided unhandled url");
                window.history.back();
            }, interval);
        });
    });
}
exports.run = run;
//# sourceMappingURL=routeService.test.js.map