We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38b017f commit 39a6f38Copy full SHA for 39a6f38
test/astx/bugs_scope.ts
@@ -0,0 +1,17 @@
1
+import { TransformOptions } from '../../src'
2
+import { astxTestcase } from '../astxTestcase'
3
+import { NodePath as AstTypesNodePath } from 'ast-types/lib/node-path'
4
+import dedent from 'dedent-js'
5
+
6
+astxTestcase({
7
+ file: __filename,
8
+ input: dedent`
9
+ const foo = 1;
10
+ `,
11
+ parsers: ['babel', 'babel/tsx'],
12
+ astx: ({ astx, report }: TransformOptions): void => {
13
+ const path = astx.find`const foo = 1;`.paths[0]
14
+ report((path as AstTypesNodePath).scope !== null)
15
+ },
16
+ expectedReports: [true],
17
+})
0 commit comments