tjson-js
Version:
Tagged JSON (TJSON): a JSON-based microformat with rich type annotations
14 lines (11 loc) • 383 B
text/typescript
import { suite, test } from "mocha-typescript";
import { expect } from "chai";
import { FloatType } from "../../src/datatype/float";
class FloatTypeTest {
"passes through floating point values"() {
expect((new FloatType).decode(42)).to.eq(42);
}
"throws Error on string values"() {
expect(() => (new FloatType).decode("42")).to.throw(Error);
}
}