Skip to content

Commit

Permalink
Adjust @babel/traverse to not rely on the exact string of the nodepat…
Browse files Browse the repository at this point in the history
…h type in its test to fixup test with ts@next (DefinitelyTyped#33782)
  • Loading branch information
weswigham authored Mar 11, 2019
1 parent 1eeccaf commit a087a25
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions types/babel__traverse/babel__traverse-tests.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import traverse, { Visitor } from "@babel/traverse";
import traverse, { Visitor, NodePath } from "@babel/traverse";
import * as t from "@babel/types";

// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
const MyVisitor: Visitor = {
Identifier: {
enter(path) {
// $ExpectType NodePath<Identifier>
path;
const x: NodePath<t.Identifier> = path;
console.log("Entered!");
},
exit(path) {
// $ExpectType NodePath<Identifier>
path;
const x: NodePath<t.Identifier> = path;
console.log("Exited!");
}
}
Expand Down

0 comments on commit a087a25

Please sign in to comment.