File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` transform basic 1` ] = `
4
+ "module.exports = {
5
+ plugins : [\\" @babel/plugin-transform-classes\\ " , \\" @babel/plugin-syntax-jsx\\ " ],
6
+ presets : [\\" @babel/preset-env\\ " ]
7
+ } ;
8
+ "
9
+ ` ;
10
+
11
+ exports [` transform function 1` ] = `
12
+ "function createBabelrc() {
13
+ return {
14
+ plugins: [
15
+ \\" @babel/plugin-transform-classes\\ " ,
16
+ \\" @babel/plugin-syntax-jsx\\ " ,
17
+ \\" @babel/plugin-proposal-pipeline-operator\\ "
18
+ ],
19
+ presets: [\\" @babel/preset-env\\ " , \\" @babel/preset-react\\ " ]
20
+ };
21
+ }
22
+
23
+ module.exports = createBabelrc();
24
+ "
25
+ ` ;
Original file line number Diff line number Diff line change
1
+ const fs = require ( 'fs' ) ;
2
+ const path = require ( 'path' ) ;
3
+ const pify = require ( 'pify' ) ;
4
+ const transform = require ( '../src/transform' ) ;
5
+
6
+ async function readFile ( configPath ) {
7
+ return ( await pify ( fs . readFile ) ( path . join ( __dirname , configPath ) , 'utf8' ) ) ;
8
+ }
9
+
10
+ describe ( 'transform' , ( ) => {
11
+ test ( 'basic' , async ( ) => {
12
+ const src = await readFile ( '../fixtures/transform/basic.js' ) ;
13
+ expect ( transform ( src ) ) . toMatchSnapshot ( ) ;
14
+ } ) ;
15
+
16
+ test ( 'function' , async ( ) => {
17
+ const src = await readFile ( '../fixtures/transform/function.js' ) ;
18
+ expect ( transform ( src ) ) . toMatchSnapshot ( ) ;
19
+ } ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ plugins : [ 'babel-plugin-transform-es2015-classes' , 'babel-plugin-syntax-jsx' ] ,
3
+ presets : [ 'babel-preset-env' ]
4
+ } ;
Original file line number Diff line number Diff line change
1
+ function createBabelrc ( ) {
2
+ return {
3
+ plugins : [
4
+ 'babel-plugin-transform-es2015-classes' ,
5
+ 'babel-plugin-syntax-jsx' ,
6
+ 'babel-plugin-transform-pipeline-operator'
7
+ ] ,
8
+ presets : [ 'babel-preset-env' , 'babel-preset-react' ]
9
+ } ;
10
+ }
11
+
12
+ module . exports = createBabelrc ( ) ;
You can’t perform that action at this time.
0 commit comments