check.js 402 B

1234567891011121314151617
  1. var test = require('tap').test;
  2. var fs = require('fs');
  3. var check = require('../');
  4. var file = __dirname + '/sources/check.js';
  5. var src = fs.readFileSync(file);
  6. test('check', function (t) {
  7. var err = check(src, file);
  8. t.ok(err);
  9. t.equal(err.line, 5);
  10. t.equal(err.column, 30);
  11. t.equal(err.message, 'Unexpected token');
  12. t.ok(String(err).indexOf(file + ':5'));
  13. t.end();
  14. });