modify-vars.js 549 B

1234567891011121314151617181920
  1. var less = require('../lib/less'),
  2. fs = require('fs');
  3. var input = fs.readFileSync('./test/less/modifyVars/extended.less', 'utf8');
  4. var expectedCss = fs.readFileSync('./test/css/modifyVars/extended.css', 'utf8');
  5. var options = {
  6. modifyVars: JSON.parse(fs.readFileSync('./test/less/modifyVars/extended.json', 'utf8'))
  7. };
  8. less.render(input, options, function (err, result) {
  9. if (err) {
  10. console.log(err);
  11. }
  12. if (result.css === expectedCss) {
  13. console.log('PASS');
  14. } else {
  15. console.log('FAIL');
  16. }
  17. });