1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/test/ocean/IdGenerator.test.ts
2018-12-17 14:29:09 +01:00

27 lines
646 B
TypeScript

import * as assert from "assert"
import IdGenerator from "../../src/ocean/IdGenerator"
describe("IdGenerator", () => {
describe("#generateId()", () => {
it("should generate an id", async () => {
const id = IdGenerator.generateId()
assert(id)
})
it("should generate an id that is 64 chars long", async () => {
const id: string = IdGenerator.generateId()
assert(id.length === 64, id)
})
it("should not contain -", async () => {
const id: string = IdGenerator.generateId()
assert(id.indexOf("-") === -1)
})
})
})