@@ -10,6 +10,7 @@ function testTransform (fixtureName, extraOptions) {
10
10
var fixtureFilepath = path . resolve ( __dirname , 'fixtures' , fixtureName , 'fixture.js' ) ;
11
11
var expectedFilepath = path . resolve ( __dirname , 'fixtures' , fixtureName , 'expected.js' ) ;
12
12
var result = babel . transformFileSync ( fixtureFilepath , extend ( {
13
+ presets : [ 'es2015' ] ,
13
14
plugins : [ '../index' ]
14
15
} , extraOptions ) ) ;
15
16
var actual = result . code ;
@@ -18,48 +19,44 @@ function testTransform (fixtureName, extraOptions) {
18
19
} ) ;
19
20
}
20
21
21
- describe ( 'babel6 challenge' , function ( ) {
22
- testTransform ( 'babel6' ) ;
22
+ describe ( 'babel-plugin-espower' , function ( ) {
23
+ testTransform ( 'NonTarget' ) ;
24
+ testTransform ( 'Literal' ) ;
25
+ testTransform ( 'Identifier' ) ;
26
+ testTransform ( 'BinaryExpression' ) ;
27
+ testTransform ( 'UnaryExpression' ) ;
28
+ testTransform ( 'LogicalExpression' ) ;
29
+ testTransform ( 'MemberExpression' ) ;
30
+ testTransform ( 'CallExpression' ) ;
31
+ testTransform ( 'AssignmentExpression' ) ;
32
+ testTransform ( 'ArrayExpression' ) ;
33
+ testTransform ( 'UpdateExpression' ) ;
34
+ testTransform ( 'ConditionalExpression' ) ;
35
+ testTransform ( 'ObjectExpression' ) ;
36
+ testTransform ( 'NewExpression' ) ;
37
+ testTransform ( 'FunctionExpression' ) ;
38
+ testTransform ( 'TemplateLiteral' ) ;
39
+ testTransform ( 'TaggedTemplateExpression' ) ;
40
+ testTransform ( 'ArrowFunctionExpression' ) ;
41
+ testTransform ( 'ClassExpression' ) ;
42
+ testTransform ( 'SpreadElement' ) ;
43
+ testTransform ( 'Property' ) ;
44
+ testTransform ( 'inputSourceMap' , {
45
+ plugins : [
46
+ createEspowerPlugin ( babel , {
47
+ sourceRoot : "/absolute/"
48
+ } )
49
+ ]
50
+ } ) ;
51
+ testTransform ( 'customPatterns' , {
52
+ plugins : [
53
+ createEspowerPlugin ( babel , {
54
+ patterns : [
55
+ 'assert.isNull(object, [message])' ,
56
+ 'assert.same(actual, expected, [message])' ,
57
+ 'assert.near(actual, expected, delta, [message])'
58
+ ]
59
+ } )
60
+ ]
61
+ } ) ;
23
62
} ) ;
24
-
25
- // describe('babel-plugin-espower', function () {
26
- // testTransform('NonTarget');
27
- // testTransform('Literal');
28
- // testTransform('Identifier');
29
- // testTransform('BinaryExpression');
30
- // testTransform('UnaryExpression');
31
- // testTransform('LogicalExpression');
32
- // testTransform('MemberExpression');
33
- // testTransform('CallExpression');
34
- // testTransform('AssignmentExpression');
35
- // testTransform('ArrayExpression');
36
- // testTransform('UpdateExpression');
37
- // testTransform('ConditionalExpression');
38
- // testTransform('ObjectExpression');
39
- // testTransform('NewExpression');
40
- // testTransform('FunctionExpression');
41
- // testTransform('TemplateLiteral');
42
- // testTransform('TaggedTemplateExpression');
43
- // testTransform('ArrowFunctionExpression');
44
- // testTransform('ClassExpression');
45
- // testTransform('SpreadElement');
46
- // testTransform('Property');
47
- // testTransform('inputSourceMap', {
48
- // plugins: [
49
- // createEspowerPlugin(babel, {
50
- // sourceRoot: "/absolute/"
51
- // })
52
- // ]
53
- // });
54
- // testTransform('customPatterns', {
55
- // plugins: [
56
- // createEspowerPlugin(babel, {
57
- // patterns: [
58
- // 'assert.isNull(object, [message])',
59
- // 'assert.same(actual, expected, [message])',
60
- // 'assert.near(actual, expected, delta, [message])'
61
- // ]
62
- // })
63
- // ]
64
- // });
65
- // });
0 commit comments