refactor(cli): rewrite Deno.transpileOnly() to use SWC (#8090)

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
Bartek Iwańczuk 2020-10-26 14:03:03 +01:00 committed by GitHub
parent aebbdd5cc2
commit 57cad53945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 178 additions and 131 deletions

View file

@ -129,17 +129,16 @@ Deno.test({
async fn() {
const actual = await Deno.transpileOnly(
{
"foo.ts": `export enum Foo { Foo, Bar, Baz };\n`,
"foo.ts": `/** This is JSDoc */\nexport enum Foo { Foo, Bar, Baz };\n`,
},
{
sourceMap: false,
module: "amd",
removeComments: true,
},
);
assert(actual);
assertEquals(Object.keys(actual), ["foo.ts"]);
assert(actual["foo.ts"].source.startsWith("define("));
assert(actual["foo.ts"].map == null);
assert(!actual["foo.ts"].source.includes("This is JSDoc"));
assert(actual["foo.ts"].map);
},
});