strings.js 477 字节
Newer Older
Five-菜鸟级's avatar
init  
Five-菜鸟级 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
var test = require('tap').test;
var detective = require('../');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/files/strings.js');

test('single', function (t) {
    t.deepEqual(detective(src), [
      {name: 'a', offset: 17}, 
      {name: 'b', offset: 39}, 
      {name: 'c', offset: 61}, 
      {name: 'events', offset: 113}, 
      {name: 'doom', offset: 154},
      {name: 'y', offset: 216}, 
      {name: 'events2', offset: 257}
    ]);
    t.end();
});