From 9e51038ad95ac96f004d6a5ce1f2b6ceb6e88d93 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 14 Aug 2017 09:20:36 -0500 Subject: [PATCH] Fix class prop test fixture (#6090) --- .../constructor-collision-ignores-types-loose/actual.js | 6 ++++++ .../constructor-collision-ignores-types-loose/expected.js | 8 ++++++++ .../options.json | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/actual.js create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/expected.js create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/options.json diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/actual.js b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/actual.js new file mode 100644 index 0000000000..593242cde2 --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/actual.js @@ -0,0 +1,6 @@ +class C { + // Output should not use `_initialiseProps` + x: T; + y = 0; + constructor(T) {} +} diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/expected.js b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/expected.js new file mode 100644 index 0000000000..688eb31db9 --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/expected.js @@ -0,0 +1,8 @@ +class C { + // Output should not use `_initialiseProps` + constructor(T) { + this.x = void 0; + this.y = 0; + } + +} diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/options.json new file mode 100644 index 0000000000..dcd8e9fbcf --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-typescript", ["transform-class-properties", {"loose": true }]] +}