You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
877 B
TypeScript
33 lines
877 B
TypeScript
import { print } from "../mod.ts";
|
|
import { assertEquals } from "./deps.ts";
|
|
|
|
Deno.test("print (no error)", () => {
|
|
const result = print({
|
|
"type": "Module",
|
|
"span": { "start": 21, "end": 33, "ctxt": 0 },
|
|
"body": [{
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": { "start": 27, "end": 28, "ctxt": 0 },
|
|
"value": "X",
|
|
"optional": false,
|
|
},
|
|
"declare": false,
|
|
"span": { "start": 21, "end": 32, "ctxt": 0 },
|
|
"decorators": [],
|
|
"body": [],
|
|
"superClass": null,
|
|
"isAbstract": false,
|
|
"typeParams": null,
|
|
"superTypeParams": null,
|
|
"implements": [],
|
|
}, {
|
|
"type": "EmptyStatement",
|
|
"span": { "start": 32, "end": 33, "ctxt": 0 },
|
|
}],
|
|
"interpreter": null,
|
|
}, {});
|
|
assertEquals(result.code.trim(), "class X {\n}\n;");
|
|
});
|