Files
languageservices/expressions/src/data/replacer.test.ts
T
Christopher Schleiden 2a3d63551f Rename folders
2023-02-22 15:52:40 -08:00

25 lines
686 B
TypeScript

import {Array} from "./array";
import {Dictionary} from "./dictionary";
import {Null} from "./null";
import {NumberData} from "./number";
import {replacer} from "./replacer";
import {StringData} from "./string";
describe("replacer", () => {
it("null", () => {
expect(JSON.stringify(new Null(), replacer, " ")).toEqual("null");
});
it("array", () => {
expect(JSON.stringify(new Array(new StringData("a"), new StringData("b")), replacer, " ")).toEqual(
'[\n "a",\n "b"\n]'
);
});
it("dictionary", () => {
expect(JSON.stringify(new Dictionary({key: "a", value: new NumberData(42)}), replacer, " ")).toEqual(
'{\n "a": 42\n}'
);
});
});