Skip to content

Commit

Permalink
refactor: add script for recorder JSON generation
Browse files Browse the repository at this point in the history
  • Loading branch information
twada committed Jan 10, 2019
1 parent 03e2642 commit dfd1382
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var path = require('path');
var fs = require('fs');
var acorn = require('acorn');
var espurify = require('espurify');

var filepath = path.join(__dirname, 'power-assert-recorder.js');
var ast = acorn.parse(fs.readFileSync(filepath), { ecmaVersion: 6, locations: true });
var callexp = espurify(ast).body[0].expression.right;
fs.writeFileSync(path.join(__dirname, 'lib', 'power-assert-recorder.json'), JSON.stringify(callexp, null, 2));

0 comments on commit dfd1382

Please sign in to comment.