You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
507 B
29 lines
507 B
import test from "node:test"
|
|
import assert from "node:assert"
|
|
import { gronify } from "./ngron.mjs";
|
|
|
|
test("number", () => {
|
|
const result = gronify(3)
|
|
|
|
assert.strictEqual(result, `json=3`)
|
|
});
|
|
|
|
test("string", () => {
|
|
const result = gronify("hello")
|
|
|
|
assert.strictEqual(result, `json="hello"`)
|
|
});
|
|
|
|
|
|
test("empty obj", () => {
|
|
const result = gronify({})
|
|
|
|
assert.strictEqual(result, `json={}`)
|
|
});
|
|
|
|
test("null", () => {
|
|
const result = gronify(null)
|
|
|
|
assert.strictEqual(result, `json=null`)
|
|
});
|