rtlcss-plugins.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module.exports = [
  2. {
  3. 'should': 'Should support plugins',
  4. 'expected': 'div:before { content: "ABC";} div:after { content: "B";}',
  5. 'input': 'div:before { content: "A";} div:after { content: "B";}',
  6. 'reversable': true,
  7. 'plugins': [
  8. {
  9. 'name': 'test',
  10. 'directives': {
  11. 'control': {},
  12. 'value': []
  13. },
  14. 'processors': [
  15. {
  16. 'name': 'content',
  17. 'expr': /content/im,
  18. 'action': function (prop, value, cxt) {
  19. if (value === '"A"') {
  20. return { 'prop': prop, 'value': '"ABC"' }
  21. } else if (value === '"ABC"') {
  22. return { 'prop': prop, 'value': '"A"' }
  23. }
  24. return { 'prop': prop, 'value': value }
  25. }
  26. }
  27. ]
  28. }
  29. ]
  30. },
  31. {
  32. 'should': 'Should allow overriding default plugin',
  33. 'expected': 'div { text-align:right;}',
  34. 'input': 'div { text-align:right;}',
  35. 'plugins': [
  36. {
  37. 'name': 'rtlcss',
  38. 'directives': {
  39. 'control': {},
  40. 'value': []
  41. },
  42. 'processors': []
  43. }
  44. ]
  45. }
  46. ]