UNPKG

iridium

Version:

A custom lightweight ORM for MongoDB designed for power-users

20 lines 792 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Iridium = require("../iridium"); const MongoDB = require("mongodb"); const chai = require("chai"); describe("Utilities", () => { describe("toObjectID", () => { it("should convert hex strings to ObjectIDs", () => { let oID = Iridium.toObjectID("aaaaaaaaaaaaaaaaaaaaaaaa"); chai.expect(oID).to.be.instanceOf(MongoDB.ObjectID); chai.expect(oID.toHexString()).to.eql("aaaaaaaaaaaaaaaaaaaaaaaa"); }); it("should throw an error if your string is not a valid ObjectID", () => { chai.expect(() => { Iridium.toObjectID("aaaaaaaaaaaaaaaa"); }).to.throw; }); }); }); //# sourceMappingURL=Utilities.js.map