From 43a63530acb16e57cbb190eacedbd097c536a775 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 13 Oct 2021 08:55:28 -0400 Subject: chore: test for bundling export specifier with alias (#12421) --- cli/tests/integration/bundle_tests.rs | 5 +++++ cli/tests/testdata/bundle/file_tests-fixture16.ts | 6 ++++++ cli/tests/testdata/bundle/file_tests-fixture16_2.ts | 2 ++ cli/tests/testdata/bundle/fixture16.out | 6 ++++++ 4 files changed, 19 insertions(+) create mode 100644 cli/tests/testdata/bundle/file_tests-fixture16.ts create mode 100644 cli/tests/testdata/bundle/file_tests-fixture16_2.ts create mode 100644 cli/tests/testdata/bundle/fixture16.out (limited to 'cli/tests') diff --git a/cli/tests/integration/bundle_tests.rs b/cli/tests/integration/bundle_tests.rs index 4e68af0b1..9010ec9b1 100644 --- a/cli/tests/integration/bundle_tests.rs +++ b/cli/tests/integration/bundle_tests.rs @@ -373,3 +373,8 @@ itest!(ts_decorators_bundle { args: "bundle ts_decorators_bundle.ts", output: "ts_decorators_bundle.out", }); + +itest!(bundle_export_specifier_with_alias { + args: "bundle bundle/file_tests-fixture16.ts", + output: "bundle/fixture16.out", +}); diff --git a/cli/tests/testdata/bundle/file_tests-fixture16.ts b/cli/tests/testdata/bundle/file_tests-fixture16.ts new file mode 100644 index 000000000..5d0b05e92 --- /dev/null +++ b/cli/tests/testdata/bundle/file_tests-fixture16.ts @@ -0,0 +1,6 @@ +// todo(dsherret): use ./subdir/a.ts once fixtures are restored +export { a as test1 } from "./file_tests-fixture16_2.ts"; +export { a as test2 } from "./file_tests-fixture16_2.ts"; +import { a } from "./file_tests-fixture16_2.ts"; + +console.log(a); diff --git a/cli/tests/testdata/bundle/file_tests-fixture16_2.ts b/cli/tests/testdata/bundle/file_tests-fixture16_2.ts new file mode 100644 index 000000000..7115949c9 --- /dev/null +++ b/cli/tests/testdata/bundle/file_tests-fixture16_2.ts @@ -0,0 +1,2 @@ +// todo(dsherret): delete this and use ./subdir/a.ts in the file once fixtures are restored +export const a = "a"; diff --git a/cli/tests/testdata/bundle/fixture16.out b/cli/tests/testdata/bundle/fixture16.out new file mode 100644 index 000000000..5e21c2a71 --- /dev/null +++ b/cli/tests/testdata/bundle/fixture16.out @@ -0,0 +1,6 @@ +[WILDCARD] +const a = "a"; +export { a as test1 }; +export { a as test2 }; +console.log(a); + -- cgit v1.2.3