Skip to content

Commit cf2d90c

Browse files
committed
✅ Add test for TypeScript
1 parent d612c9e commit cf2d90c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/typescript/nursery.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { setup } = require('@ast-grep/nursery')
2+
const assert = require('node:assert')
23
const languageRegistration = require('./index')
34
const path = require('node:path')
45

@@ -9,6 +10,9 @@ setup({
910
src: path.join('typescript', 'src'),
1011
languageRegistration,
1112
testRunner: parse => {
12-
// add test here
13+
const sg = parse('let x: number = 123')
14+
const root = sg.root()
15+
const node = root.find('let $VAR: number = $VALUE')
16+
assert.equal(node.kind(), 'lexical_declaration')
1317
},
1418
})

0 commit comments

Comments
 (0)