Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (17 sloc) 678 Bytes
#!/usr/bin/env node
var parse = require('./parse');
var tests = require('postcss-parser-tests');
var path = require('path');
var fs = require('fs');
var dir = path.join(__dirname, 'test', 'cases');
fs.readdirSync(dir).filter(function (i) {
return path.extname(i) === '.sss';
}).forEach(function (name) {
var sssFile = path.join(dir, name);
var cssFile = sssFile.replace(/\.sss/, '.css');
var jsonFile = sssFile.replace(/\.sss/, '.json');
var sss = fs.readFileSync(sssFile).toString();
var root = parse(sss, { from: name });
fs.writeFileSync(cssFile, root.toString());
fs.writeFileSync(jsonFile, tests.jsonify(root) + '\n');
});