UNPKG

wonder.js

Version:
39 lines (35 loc) 2.62 kB
'use strict'; var Curry = require("bs-platform/lib/js/curry.js"); var Sinon = require("wonder-bs-sinon/lib/js/src/sinon.js"); var Sinon$1 = require("sinon"); var Wonder_jest = require("wonder-bs-jest/lib/js/src/wonder_jest.js"); var TestTool$Wonderjs = require("../../../../tool/TestTool.js"); var DirectorTool$Wonderjs = require("../../../../tool/core/DirectorTool.js"); var MainStateTool$Wonderjs = require("../../../../tool/service/state/MainStateTool.js"); var TimeControllerTool$Wonderjs = require("../../../../tool/service/timeController/TimeControllerTool.js"); var NoWorkerJobConfigTool$Wonderjs = require("../../../../tool/service/noWorkerJob/NoWorkerJobConfigTool.js"); Wonder_jest.describe("test start time job", (function (param) { var sandbox = Sinon.getSandboxDefaultVal(/* () */0); var state = /* record */[/* contents */MainStateTool$Wonderjs.createState(/* () */0)]; var _buildNoWorkerJobConfig = function (param) { return NoWorkerJobConfigTool$Wonderjs.buildNoWorkerJobConfig(undefined, "\n [\n {\n \"name\": \"default\",\n \"jobs\": [\n {\n \"name\": \"start_time\"\n }\n ]\n }\n ]\n ", undefined, "\n[\n {\n \"name\": \"start_time\"\n }\n]\n ", undefined, /* () */0); }; beforeEach((function () { sandbox[0] = Sinon$1.sandbox.create(); state[0] = TestTool$Wonderjs.initWithJobConfigWithoutBuildFakeDom(sandbox, undefined, undefined, undefined, undefined, undefined, _buildNoWorkerJobConfig(/* () */0), undefined, /* () */0); return /* () */0; })); afterEach((function () { return Curry._1(Sinon.restoreSandbox, sandbox[0]); })); Wonder_jest.test("set start time to now", (function (param) { TimeControllerTool$Wonderjs.setStartTime(1.5); var state$1 = DirectorTool$Wonderjs.init(state[0]); return Curry._2(Wonder_jest.Expect[/* Operators */25][/* = */5], Wonder_jest.Expect[/* expect */0](TimeControllerTool$Wonderjs.getTimeControllerRecord(state$1)[/* startTime */1]), 1.5); })); return Wonder_jest.test("set elapsed to 0", (function (param) { var state$1 = DirectorTool$Wonderjs.init(state[0]); return Curry._2(Wonder_jest.Expect[/* Operators */25][/* = */5], Wonder_jest.Expect[/* expect */0](TimeControllerTool$Wonderjs.getTimeControllerRecord(state$1)[/* elapsed */0]), 0); })); })); /* Not a pure module */