diff options
author | juju <gliheng@live.com> | 2022-01-12 20:05:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 13:05:06 +0100 |
commit | 50e8ab8a8630a272e9862f2fb7014107474405c6 (patch) | |
tree | f6c070945cc67d6b30506d422cdf23d5cb58babd /cli/tests/testdata/compiler_api_test.ts | |
parent | 62291e9b0e99406ac7f5a95dc329400f9f966825 (diff) |
feat(cli): add ignore directives to bundled code (#13309)
This commit adds lint and fmt ignore directives to bundled
code as well as a comment stating that the code was bundled
and shouldn't be edited manually.
Diffstat (limited to 'cli/tests/testdata/compiler_api_test.ts')
-rw-r--r-- | cli/tests/testdata/compiler_api_test.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/testdata/compiler_api_test.ts b/cli/tests/testdata/compiler_api_test.ts index 30fc19d5f..41378f941 100644 --- a/cli/tests/testdata/compiler_api_test.ts +++ b/cli/tests/testdata/compiler_api_test.ts @@ -418,10 +418,21 @@ Deno.test({ "/b.ts": `export const b = "b";`, }, }); + const ignoreDirecives = [ + "// deno-fmt-ignore-file", + "// deno-lint-ignore-file", + "// This code was bundled using `deno bundle` and it's not recommended to edit it manually", + "", + "", + ].join("\n"); assert(diagnostics); assertEquals(diagnostics.length, 0); assertEquals(Object.keys(files).length, 2); - assert(files["deno:///bundle.js"].startsWith("(function() {\n")); + assert( + files["deno:///bundle.js"].startsWith( + ignoreDirecives + "(function() {\n", + ), + ); assert(files["deno:///bundle.js"].endsWith("})();\n")); assert(files["deno:///bundle.js.map"]); }, |