runner.config.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. var path = require('path');
  2. var resolve = require('resolve')
  3. var rootFolder = path.resolve(__dirname, '../../../');
  4. var testFolder = path.relative(rootFolder, path.dirname(resolve.sync('@less/test-data')))
  5. var lessFolder = path.join(testFolder, 'less');
  6. module.exports = {
  7. main: {
  8. // src is used to build list of less files to compile
  9. src: [
  10. `${lessFolder}/_main/*.less`,
  11. `!${lessFolder}/_main/plugin-preeval.less`, // uses ES6 syntax
  12. // Don't test NPM import, obviously
  13. `!${lessFolder}/_main/plugin-module.less`,
  14. `!${lessFolder}/_main/import-module.less`,
  15. `!${lessFolder}/_main/javascript.less`,
  16. `!${lessFolder}/_main/urls.less`,
  17. `!${lessFolder}/_main/empty.less`
  18. ],
  19. options: {
  20. helpers: 'test/browser/runner-main-options.js',
  21. specs: 'test/browser/runner-main-spec.js',
  22. outfile: 'tmp/browser/test-runner-main.html'
  23. }
  24. },
  25. legacy: {
  26. src: [`${lessFolder}/legacy/*.less`],
  27. options: {
  28. helpers: 'test/browser/runner-legacy-options.js',
  29. specs: 'test/browser/runner-legacy-spec.js',
  30. outfile: 'tmp/browser/test-runner-legacy.html'
  31. }
  32. },
  33. strictUnits: {
  34. src: [`${lessFolder}/strict-units/*.less`],
  35. options: {
  36. helpers: 'test/browser/runner-strict-units-options.js',
  37. specs: 'test/browser/runner-strict-units-spec.js',
  38. outfile: 'tmp/browser/test-runner-strict-units.html'
  39. }
  40. },
  41. errors: {
  42. src: [
  43. `${lessFolder}/errors/*.less`,
  44. `${testFolder}/errors/javascript-error.less`,
  45. 'test/browser/less/errors/*.less'
  46. ],
  47. options: {
  48. timeout: 20000,
  49. helpers: 'test/browser/runner-errors-options.js',
  50. specs: 'test/browser/runner-errors-spec.js',
  51. outfile: 'tmp/browser/test-runner-errors.html'
  52. }
  53. },
  54. noJsErrors: {
  55. src: [`${lessFolder}/no-js-errors/*.less`],
  56. options: {
  57. helpers: 'test/browser/runner-no-js-errors-options.js',
  58. specs: 'test/browser/runner-no-js-errors-spec.js',
  59. outfile: 'tmp/browser/test-runner-no-js-errors.html'
  60. }
  61. },
  62. browser: {
  63. src: [
  64. 'test/browser/less/*.less',
  65. 'test/browser/less/plugin/*.less'
  66. ],
  67. options: {
  68. helpers: 'test/browser/runner-browser-options.js',
  69. specs: 'test/browser/runner-browser-spec.js',
  70. outfile: 'tmp/browser/test-runner-browser.html'
  71. }
  72. },
  73. relativeUrls: {
  74. src: ['test/browser/less/relative-urls/*.less'],
  75. options: {
  76. helpers: 'test/browser/runner-relative-urls-options.js',
  77. specs: 'test/browser/runner-relative-urls-spec.js',
  78. outfile: 'tmp/browser/test-runner-relative-urls.html'
  79. }
  80. },
  81. rewriteUrls: {
  82. src: ['test/browser/less/rewrite-urls/*.less'],
  83. options: {
  84. helpers: 'test/browser/runner-rewrite-urls-options.js',
  85. specs: 'test/browser/runner-rewrite-urls-spec.js',
  86. outfile: 'tmp/browser/test-runner-rewrite-urls.html'
  87. }
  88. },
  89. rootpath: {
  90. src: ['test/browser/less/rootpath/*.less'],
  91. options: {
  92. helpers: 'test/browser/runner-rootpath-options.js',
  93. specs: 'test/browser/runner-rootpath-spec.js',
  94. outfile: 'tmp/browser/test-runner-rootpath.html'
  95. }
  96. },
  97. rootpathRelative: {
  98. src: ['test/browser/less/rootpath-relative/*.less'],
  99. options: {
  100. helpers: 'test/browser/runner-rootpath-relative-options.js',
  101. specs: 'test/browser/runner-rootpath-relative-spec.js',
  102. outfile: 'tmp/browser/test-runner-rootpath-relative.html'
  103. }
  104. },
  105. rootpathRewriteUrls: {
  106. src: ['test/browser/less/rootpath-rewrite-urls/*.less'],
  107. options: {
  108. helpers:
  109. 'test/browser/runner-rootpath-rewrite-urls-options.js',
  110. specs: 'test/browser/runner-rootpath-rewrite-urls-spec.js',
  111. outfile:
  112. 'tmp/browser/test-runner-rootpath-rewrite-urls.html'
  113. }
  114. },
  115. production: {
  116. src: ['test/browser/less/production/*.less'],
  117. options: {
  118. helpers: 'test/browser/runner-production-options.js',
  119. specs: 'test/browser/runner-production-spec.js',
  120. outfile: 'tmp/browser/test-runner-production.html'
  121. }
  122. },
  123. modifyVars: {
  124. src: ['test/browser/less/modify-vars/*.less'],
  125. options: {
  126. helpers: 'test/browser/runner-modify-vars-options.js',
  127. specs: 'test/browser/runner-modify-vars-spec.js',
  128. outfile: 'tmp/browser/test-runner-modify-vars.html'
  129. }
  130. },
  131. globalVars: {
  132. src: ['test/browser/less/global-vars/*.less'],
  133. options: {
  134. helpers: 'test/browser/runner-global-vars-options.js',
  135. specs: 'test/browser/runner-global-vars-spec.js',
  136. outfile: 'tmp/browser/test-runner-global-vars.html'
  137. }
  138. },
  139. postProcessorPlugin: {
  140. src: [`${lessFolder}/postProcessorPlugin/*.less`],
  141. options: {
  142. helpers: [
  143. 'test/plugins/postprocess/index.js',
  144. 'test/browser/runner-postProcessorPlugin-options.js'
  145. ],
  146. specs: 'test/browser/runner-postProcessorPlugin.js',
  147. outfile:
  148. 'tmp/browser/test-runner-post-processor-plugin.html'
  149. }
  150. },
  151. preProcessorPlugin: {
  152. src: [`${lessFolder}/preProcessorPlugin/*.less`],
  153. options: {
  154. helpers: [
  155. 'test/plugins/preprocess/index.js',
  156. 'test/browser/runner-preProcessorPlugin-options.js'
  157. ],
  158. specs: 'test/browser/runner-preProcessorPlugin.js',
  159. outfile: 'tmp/browser/test-runner-pre-processor-plugin.html'
  160. }
  161. },
  162. visitorPlugin: {
  163. src: [`${lessFolder}/visitorPlugin/*.less`],
  164. options: {
  165. helpers: [
  166. 'test/plugins/visitor/index.js',
  167. 'test/browser/runner-VisitorPlugin-options.js'
  168. ],
  169. specs: 'test/browser/runner-VisitorPlugin.js',
  170. outfile: 'tmp/browser/test-runner-visitor-plugin.html'
  171. }
  172. },
  173. filemanagerPlugin: {
  174. src: [`${lessFolder}/filemanagerPlugin/*.less`],
  175. options: {
  176. helpers: [
  177. 'test/plugins/filemanager/index.js',
  178. 'test/browser/runner-filemanagerPlugin-options.js'
  179. ],
  180. specs: 'test/browser/runner-filemanagerPlugin.js',
  181. outfile: 'tmp/browser/test-runner-filemanager-plugin.html'
  182. }
  183. }
  184. }