std/front_matter/json_test.ts
Lino Le Van c46143f0ac
chore: update copyright year (#4046)
* chore: update copyright year

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-02 08:11:32 +11:00

27 lines
706 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { test } from "./test.ts";
import { extract } from "./json.ts";
import {
runExtractJSONTests,
runExtractTypeErrorTests,
runTestInvalidInputTests,
runTestValidInputTests,
} from "./_test_utils.ts";
Deno.test("[JSON] test valid input true", () => {
runTestValidInputTests("json", test);
});
Deno.test("[JSON] test invalid input false", () => {
runTestInvalidInputTests("json", test);
});
Deno.test("[JSON] extract type error on invalid input", () => {
runExtractTypeErrorTests("json", extract);
});
Deno.test("[JSON] parse json delineate by ---json", async () => {
await runExtractJSONTests(extract);
});