modify-vars.js 547 B

12345678910111213141516171819
  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. });