You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
7 years ago
|
var astw = require('../');
|
||
|
var test = require('tape');
|
||
|
|
||
|
test('json', function (t) {
|
||
|
t.plan(2);
|
||
|
var numbers = [ 1, 2 ];
|
||
|
var walk = astw('{"a":1,"b":2}');
|
||
|
walk(function (node) {
|
||
|
if (node.type === 'Literal' && typeof node.value === 'number') {
|
||
|
t.equal(node.value, numbers.shift());
|
||
|
}
|
||
|
});
|
||
|
});
|