From f2f226b4f22b3e0afc66c56d251cbdb1c35b865e Mon Sep 17 00:00:00 2001 From: Artem Yavorsky Date: Thu, 23 Mar 2017 00:52:10 +0200 Subject: [PATCH] Add syntax-object-rest-spread as devDep for tests. --- .../package.json | 3 ++- .../strict/export-const-destructuring-object-rest/actual.js | 1 + .../export-const-destructuring-object-rest/expected.js | 5 +++++ .../test/fixtures/strict/options.json | 5 ++++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/actual.js create mode 100644 packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/expected.js diff --git a/packages/babel-plugin-transform-es2015-modules-commonjs/package.json b/packages/babel-plugin-transform-es2015-modules-commonjs/package.json index 148504224f..416648c85c 100644 --- a/packages/babel-plugin-transform-es2015-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-es2015-modules-commonjs/package.json @@ -15,6 +15,7 @@ "babel-plugin" ], "devDependencies": { - "babel-helper-plugin-test-runner": "^6.24.0" + "babel-helper-plugin-test-runner": "^6.24.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" } } diff --git a/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/actual.js b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/actual.js new file mode 100644 index 0000000000..d4d52568ce --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/actual.js @@ -0,0 +1 @@ +export const { foo, ...bar } = {}; diff --git a/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/expected.js b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/expected.js new file mode 100644 index 0000000000..4e27e34014 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/expected.js @@ -0,0 +1,5 @@ +"use strict"; + +const { foo, ...bar } = {}; +exports.foo = foo; +exports.bar = bar; diff --git a/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/options.json b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/options.json index b2db9b9205..064550a7c2 100644 --- a/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/options.json +++ b/packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/options.json @@ -1,3 +1,6 @@ { - "plugins": ["external-helpers", ["transform-es2015-modules-commonjs", { "strict": true }]] + "plugins": [ + "external-helpers", + "syntax-object-rest-spread", + ["transform-es2015-modules-commonjs", { "strict": true }]] }