浏览代码

Added babel plugins for transpiling destructing in default params.

Oskar Wrobel 9 年之前
父节点
当前提交
efe3b6285c
共有 3 个文件被更改,包括 7 次插入15 次删除
  1. 5 1
      dev/tasks/build/utils.js
  2. 0 14
      dev/tests/build/utils.js
  3. 2 0
      package.json

+ 5 - 1
dev/tasks/build/utils.js

@@ -209,7 +209,11 @@ require( [ 'tests' ], bender.defer(), function( err ) {
 			//
 			// Anyway, I haven't found in the docs that you can also pass a plugin instance here,
 			// but it works... so let's hope it will.
-			require( `babel-plugin-transform-es2015-modules-${ babelModuleTranspiler }` )
+			require( `babel-plugin-transform-es2015-modules-${ babelModuleTranspiler }` ),
+
+			// Istanbul doesn't support some of ES6 features we are using.
+			require( 'babel-plugin-transform-es2015-destructuring' ),
+			require( 'babel-plugin-transform-es2015-parameters' )
 		];
 	},
 

+ 0 - 14
dev/tests/build/utils.js

@@ -188,20 +188,6 @@ describe( 'build-utils', () => {
 		} );
 	} );
 
-	describe( 'getBabelPlugins', () => {
-		it( 'should return plugins for amd format', () => {
-			expect( utils.getBabelPlugins( 'amd' ) ).to.be.an( 'array' );
-		} );
-
-		it( 'should throw an exception when incorrect format is provided', () => {
-			const format = 'incorrect-format';
-
-			expect( () => {
-				utils.getBabelPlugins( format );
-			} ).to.throw( Error, `Incorrect format: ${ format }` );
-		} );
-	} );
-
 	describe( 'getConversionStreamGenerator', () => {
 		beforeEach( () => {
 			sandbox.stub( utils, 'getBabelOptionsForSource', () => 'src' );

+ 2 - 0
package.json

@@ -26,8 +26,10 @@
   "devDependencies": {
     "almond": "^0.3.0",
     "babel-core": "^6.4.0",
+    "babel-plugin-transform-es2015-destructuring": "^6.9.0",
     "babel-plugin-transform-es2015-modules-amd": "^6.1.18",
     "babel-plugin-transform-es2015-modules-commonjs": "^6.2.0",
+    "babel-plugin-transform-es2015-parameters": "^6.9.0",
     "benderjs": "^0.4.1",
     "benderjs-chai": "^0.2.0",
     "benderjs-coverage": "benderjs/benderjs-coverage#t/4",