runner-modify-vars-spec.js 867 B

123456789101112131415161718192021222324252627282930313233
  1. var alreadyRun = false;
  2. describe('less.js modify vars', function () {
  3. beforeEach(function (done) {
  4. // simulating "setUp" or "beforeAll" method
  5. if (alreadyRun) {
  6. done();
  7. return;
  8. }
  9. alreadyRun = true;
  10. less.pageLoadFinished
  11. .then(function () {
  12. less.modifyVars({
  13. var1: 'green',
  14. var2: 'purple',
  15. scale: 20
  16. }).then(function () {
  17. done();
  18. });
  19. });
  20. });
  21. testLessEqualsInDocument();
  22. it('Should log only 2 XHR requests', function (done) {
  23. var xhrLogMessages = logMessages.filter(function (item) {
  24. return (/XHR: Getting '/).test(item);
  25. });
  26. expect(xhrLogMessages.length).to.equal(2);
  27. done();
  28. });
  29. });