UNPKG

tjson-js

Version:

Tagged JSON (TJSON): a JSON-based microformat with rich type annotations

14 lines (11 loc) 383 B
import { suite, test } from "mocha-typescript"; import { expect } from "chai"; import { FloatType } from "../../src/datatype/float"; @suite class FloatTypeTest { @test "passes through floating point values"() { expect((new FloatType).decode(42)).to.eq(42); } @test "throws Error on string values"() { expect(() => (new FloatType).decode("42")).to.throw(Error); } }