Mirror: The magical sticky regex-based parser generator 🧙
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add test case for self-referential thunk

+29
+10
src/babel/__snapshots__/plugin.test.js.snap
··· 130 130 };" 131 131 `; 132 132 133 + exports[`works with self-referential thuns 1`] = ` 134 + "import { match, tag, _exec, _pattern } from 'reghex'; 135 + const inner = m('inner')\` 136 + \${() => node} 137 + \`; 138 + const node = m('node')\` 139 + \${inner} 140 + \`;" 141 + `; 142 + 133 143 exports[`works with standard features 1`] = ` 134 144 "import { match, _exec, _pattern, tag as _tag } from \\"reghex\\"; 135 145
+19
src/babel/plugin.test.js
··· 54 54 ).toMatchSnapshot(); 55 55 }); 56 56 57 + it('works with self-referential thuns', () => { 58 + const code = ` 59 + import { match, tag } from 'reghex'; 60 + 61 + const inner = m('inner')\` 62 + \${() => node} 63 + \`; 64 + 65 + const node = m('node')\` 66 + \${inner} 67 + \`; 68 + `; 69 + 70 + expect( 71 + transform(code, { babelrc: false, presets: [], plugins: [reghexPlugin] }) 72 + .code 73 + ).toMatchSnapshot(); 74 + }); 75 + 57 76 it('works with transform functions', () => { 58 77 const code = ` 59 78 import { match } from 'reghex';