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 }]] +}