runner-modify-vars-spec.js 866 B

12345678910111213141516171819202122232425262728293031323334
  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).toEqual(2);
  27. done();
  28. });
  29. });