Add clearCache test

This commit is contained in:
Amjad Masad
2016-03-07 12:50:57 -08:00
parent d5e78384ef
commit ec18fa0059

View File

@@ -123,4 +123,26 @@ suite("traverse", function () {
assert.ok(!traverse.hasType(ast, null, "ArrowFunctionExpression"));
});
test("clearCache", function () {
var paths = [];
traverse(ast, {
enter: function (path) {
paths.push(path);
}
});
traverse.clearCache();
var paths2 = [];
traverse(ast, {
enter: function (path) {
paths2.push(path);
}
});
paths2.forEach(function (p, i) {
assert.notStrictEqual(p, paths[i]);
});
});
});