UNPKG

realm-object-server

Version:

Realm Object Server

32 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const checkEngine_1 = require("./checkEngine"); const sinon = require("sinon"); const ProcessUtil_1 = require("./ProcessUtil"); describe("checkEngine", () => { let versionStub; let exitStub; let errorStub; beforeEach(() => { versionStub = sinon.stub(process, "version"); exitStub = sinon.stub(process, "exit"); errorStub = sinon.stub(console, "error"); }); afterEach(() => { versionStub.restore(); exitStub.restore(); errorStub.restore(); }); it("should do nothing with 6.11.3", () => { versionStub.get(() => { return "6.11.3"; }); checkEngine_1.checkEngine(); sinon.assert.notCalled(exitStub); }); it("should exit with 6.11.2", () => { versionStub.get(() => { return "6.11.2"; }); checkEngine_1.checkEngine(); sinon.assert.calledWith(errorStub, "Required node version >=6.11.3 not satisfied with current version 6.11.2."); sinon.assert.calledWith(exitStub, ProcessUtil_1.ProcessUtil.ErrorExitCode); }); }); //# sourceMappingURL=checkEngine.spec.js.map