js-build-tools 2.4.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +334 -205
  2. package/dist/build.js +59 -48
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +12 -13
  5. package/dist/bundle.min.js +1 -1
  6. package/dist/bundleLint.js +17 -18
  7. package/dist/bundleLint.min.js +1 -1
  8. package/dist/bundleMinify.js +8 -9
  9. package/dist/bundleMinify.min.js +1 -1
  10. package/dist/copyFonts.js +12 -0
  11. package/dist/copyFonts.min.js +1 -0
  12. package/dist/default.js +1 -1
  13. package/dist/default.min.js +1 -1
  14. package/dist/dist.js +7 -8
  15. package/dist/distLint.js +17 -18
  16. package/dist/distLint.min.js +1 -1
  17. package/dist/distMinify.js +8 -9
  18. package/dist/distMinify.min.js +1 -1
  19. package/dist/images.js +11 -0
  20. package/dist/images.min.js +1 -0
  21. package/dist/partials/addToReadme.js +13 -14
  22. package/dist/partials/beginWatcher.js +9 -10
  23. package/dist/partials/clean.js +10 -11
  24. package/dist/partials/copyFor.js +16 -0
  25. package/dist/partials/distFor.js +16 -17
  26. package/dist/partials/distForSrc.js +9 -10
  27. package/dist/partials/distSeries.js +19 -20
  28. package/dist/partials/imagesFor.js +34 -0
  29. package/dist/partials/minifyFor.js +15 -16
  30. package/dist/partials/readmeTemplate.js +11 -12
  31. package/dist/partials/removeDirectory.js +11 -12
  32. package/dist/partials/runOnChange.js +27 -27
  33. package/dist/partials/sassFor.js +20 -21
  34. package/dist/partials/tsFor.js +20 -21
  35. package/dist/partials.js +35 -31
  36. package/dist/partials.min.js +1 -1
  37. package/dist/test-helpers/setUp.js +52 -60
  38. package/dist/testFull.js +17 -18
  39. package/dist/testFull.min.js +1 -1
  40. package/dist/testHelpers.js +10 -28
  41. package/dist/testHelpers.min.js +1 -1
  42. package/dist/testQuick.js +19 -20
  43. package/dist/testQuick.min.js +1 -1
  44. package/dist/typeScript.js +7 -8
  45. package/dist/utilities/dotGet.js +50 -0
  46. package/dist/utilities/dotNotate.js +77 -0
  47. package/dist/utilities/dotSet.js +44 -0
  48. package/dist/utilities/isObject.js +10 -0
  49. package/dist/utilities/strAfter.js +14 -0
  50. package/dist/utilities/strBefore.js +14 -0
  51. package/dist/watchFull.js +10 -11
  52. package/dist/watchTest.js +13 -14
  53. package/dist/watchTest.min.js +1 -1
  54. package/functions/build.js +15 -5
  55. package/functions/build.test.js +278 -42
  56. package/functions/bundle.js +3 -4
  57. package/functions/bundle.test.js +6 -6
  58. package/functions/bundleLint.js +2 -3
  59. package/functions/bundleLint.test.js +5 -5
  60. package/functions/bundleMinify.js +1 -2
  61. package/functions/bundleMinify.test.js +1 -1
  62. package/functions/copyFonts.js +11 -0
  63. package/functions/copyFonts.test.js +31 -0
  64. package/functions/default.js +1 -1
  65. package/functions/default.test.js +2 -2
  66. package/functions/dist.js +0 -1
  67. package/functions/dist.test.js +1 -1
  68. package/functions/distLint.js +2 -3
  69. package/functions/distLint.test.js +3 -3
  70. package/functions/distMinify.js +1 -2
  71. package/functions/distMinify.test.js +1 -1
  72. package/functions/images.js +10 -0
  73. package/functions/images.test.js +138 -0
  74. package/functions/partials/addToReadme.js +2 -3
  75. package/functions/partials/addToReadme.test.js +2 -2
  76. package/functions/partials/beginWatcher.js +1 -2
  77. package/functions/partials/beginWatcher.test.js +1 -1
  78. package/functions/partials/clean.js +0 -1
  79. package/functions/partials/copyFor.js +13 -0
  80. package/functions/partials/copyFor.test.js +34 -0
  81. package/functions/partials/distFor.js +1 -2
  82. package/functions/partials/distFor.test.js +4 -4
  83. package/functions/partials/distForSrc.js +3 -4
  84. package/functions/partials/distForSrc.test.js +6 -6
  85. package/functions/partials/distSeries.js +2 -3
  86. package/functions/partials/distSeries.test.js +5 -5
  87. package/functions/partials/imagesFor.js +33 -0
  88. package/functions/partials/imagesFor.test.js +143 -0
  89. package/functions/partials/minifyFor.js +0 -1
  90. package/functions/partials/minifyFor.test.js +1 -1
  91. package/functions/partials/readmeTemplate.js +3 -4
  92. package/functions/partials/readmeTemplate.test.js +2 -2
  93. package/functions/partials/removeDirectory.js +0 -1
  94. package/functions/partials/runOnChange.js +5 -6
  95. package/functions/partials/runOnChange.test.js +9 -9
  96. package/functions/partials/sassFor.js +1 -2
  97. package/functions/partials/sassFor.test.js +3 -3
  98. package/functions/partials/tsFor.js +3 -4
  99. package/functions/partials/tsFor.test.js +2 -2
  100. package/functions/partials.js +5 -1
  101. package/functions/partials.test.js +1 -1
  102. package/functions/sass.test.js +2 -2
  103. package/functions/test-helpers/setUp.js +24 -32
  104. package/functions/testFull.js +2 -3
  105. package/functions/testFull.test.js +1 -1
  106. package/functions/testHelpers.js +3 -20
  107. package/functions/testHelpers.test.js +1 -1
  108. package/functions/testQuick.js +1 -2
  109. package/functions/testQuick.test.js +1 -1
  110. package/functions/typeScript.js +0 -1
  111. package/functions/typeScript.test.js +0 -2
  112. package/functions/utilities/dotGet.js +47 -0
  113. package/functions/utilities/dotNotate.js +68 -0
  114. package/functions/utilities/dotSet.js +41 -0
  115. package/functions/utilities/isObject.js +9 -0
  116. package/functions/utilities/strAfter.js +13 -0
  117. package/functions/utilities/strBefore.js +13 -0
  118. package/functions/watchFull.js +0 -1
  119. package/functions/watchFull.test.js +1 -1
  120. package/functions/watchTest.js +1 -2
  121. package/functions/watchTest.test.js +1 -1
  122. package/gulp.config.js +153 -79
  123. package/gulpfile.base.js +5 -1
  124. package/jsdoc.base.js +1 -1
  125. package/package.json +13 -9
  126. package/vendor/array-union/index.js +31 -0
  127. package/vendor/easy-transform-stream/index.js +54 -0
  128. package/vendor/globby/gitignore.js +96 -0
  129. package/vendor/globby/index.js +191 -0
  130. package/vendor/globby/node_modules/slash/index.js +16 -0
  131. package/vendor/globby/stream-utils.js +58 -0
  132. package/vendor/globby/to-path.js +20 -0
  133. package/vendor/gulp-imagemin/index.js +128 -0
  134. package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +265 -0
  135. package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +36 -0
  136. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  137. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  138. package/vendor/gulp-plugin-extras/index.js +42 -0
  139. package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +265 -0
  140. package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +36 -0
  141. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  142. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  143. package/vendor/gulp-plugin-extras/plugin-error.js +145 -0
  144. package/vendor/ignore/index.js +468 -0
  145. package/vendor/imagemin/index.js +90 -0
  146. package/vendor/imagemin-gifsicle/index.js +33 -0
  147. package/vendor/imagemin-mozjpeg/index.js +100 -0
  148. package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +260 -0
  149. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +47 -0
  150. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +102 -0
  151. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +123 -0
  152. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +47 -0
  153. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +50 -0
  154. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +124 -0
  155. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +238 -0
  156. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +89 -0
  157. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +24 -0
  158. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +44 -0
  159. package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +25 -0
  160. package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +70 -0
  161. package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +52 -0
  162. package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +43 -0
  163. package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +20 -0
  164. package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +17 -0
  165. package/vendor/imagemin-optipng/index.js +44 -0
  166. package/vendor/imagemin-svgo/index.js +27 -0
  167. package/vendor/is-jpg/index.js +12 -0
  168. package/vendor/junk/index.js +49 -0
  169. package/vendor/mozjpeg/index.js +9 -0
  170. package/vendor/mozjpeg/lib/index.js +18 -0
  171. package/vendor/mozjpeg/package.json +49 -0
  172. package/vendor/mozjpeg/vendor/cjpeg +0 -0
  173. package/vendor/mozjpeg/vendor/source/mozjpeg.tar.gz +0 -0
  174. package/vendor/p-pipe/index.js +22 -0
  175. package/vendor/plur/index.js +32 -0
  176. package/vendor/pretty-bytes/index.js +71 -0
  177. package/vendor/slash/index.js +12 -0
  178. package/dist/test-helpers/circularObject.js +0 -50
  179. package/dist/test-helpers/countMatches.js +0 -12
  180. package/dist/test-helpers/deepReferenceObject.js +0 -20
  181. package/dist/test-helpers/domItem.js +0 -33
  182. package/dist/test-helpers/jsonDom.js +0 -20
  183. package/dist/test-helpers/linkedList.js +0 -23
  184. package/dist/test-helpers/logObject.js +0 -21
  185. package/dist/test-helpers/multiReferenceObject.js +0 -20
  186. package/dist/test-helpers/nodeTree.js +0 -28
  187. package/functions/test-helpers/circularObject.js +0 -28
  188. package/functions/test-helpers/circularObject.test.js +0 -14
  189. package/functions/test-helpers/countMatches.js +0 -11
  190. package/functions/test-helpers/countMatches.test.js +0 -9
  191. package/functions/test-helpers/deepReferenceObject.js +0 -25
  192. package/functions/test-helpers/deepReferenceObject.test.js +0 -7
  193. package/functions/test-helpers/domItem.js +0 -31
  194. package/functions/test-helpers/domItem.test.js +0 -12
  195. package/functions/test-helpers/jsonDom.js +0 -16
  196. package/functions/test-helpers/jsonDom.test.js +0 -12
  197. package/functions/test-helpers/linkedList.js +0 -10
  198. package/functions/test-helpers/linkedList.test.js +0 -22
  199. package/functions/test-helpers/logObject.js +0 -18
  200. package/functions/test-helpers/logObject.test.js +0 -20
  201. package/functions/test-helpers/multiReferenceObject.js +0 -25
  202. package/functions/test-helpers/multiReferenceObject.test.js +0 -14
  203. package/functions/test-helpers/nodeTree.js +0 -11
  204. package/functions/test-helpers/nodeTree.test.js +0 -18
@@ -0,0 +1,143 @@
1
+ const fs = require('fs')
2
+ const setUp = require('../test-helpers/setUp')
3
+ setUp.setDefaults('test-images-for')
4
+ const gulpConfig = setUp.gulpConfig
5
+ const imagesFor = require('./imagesFor.js')
6
+
7
+ const imageContents = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' +
8
+ '<!-- Created with Inkscape (http://www.inkscape.org/) -->\n' +
9
+ '\n' +
10
+ '<svg\n' +
11
+ ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n' +
12
+ ' xmlns:cc="http://creativecommons.org/ns#"\n' +
13
+ ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' +
14
+ ' xmlns:svg="http://www.w3.org/2000/svg"\n' +
15
+ ' xmlns="http://www.w3.org/2000/svg"\n' +
16
+ ' xmlns:xlink="http://www.w3.org/1999/xlink"\n' +
17
+ ' xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n' +
18
+ ' xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n' +
19
+ ' id="svg2"\n' +
20
+ ' version="1.1"\n' +
21
+ ' inkscape:version="0.91 r13725"\n' +
22
+ ' width="600"\n' +
23
+ ' height="600"\n' +
24
+ ' viewBox="0 0 600 600"\n' +
25
+ ' sodipodi:docname="logo.svg">\n' +
26
+ ' <metadata\n' +
27
+ ' id="metadata8">\n' +
28
+ ' <rdf:RDF>\n' +
29
+ ' <cc:Work\n' +
30
+ ' rdf:about="">\n' +
31
+ ' <dc:format>image/svg+xml</dc:format>\n' +
32
+ ' <dc:type\n' +
33
+ ' rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n' +
34
+ ' <dc:title></dc:title>\n' +
35
+ ' </cc:Work>\n' +
36
+ ' </rdf:RDF>\n' +
37
+ ' </metadata>\n' +
38
+ ' <defs\n' +
39
+ ' id="defs6" />\n' +
40
+ ' <sodipodi:namedview\n' +
41
+ ' pagecolor="#ffffff"\n' +
42
+ ' bordercolor="#666666"\n' +
43
+ ' borderopacity="1"\n' +
44
+ ' objecttolerance="10"\n' +
45
+ ' gridtolerance="10"\n' +
46
+ ' guidetolerance="10"\n' +
47
+ ' inkscape:pageopacity="0"\n' +
48
+ ' inkscape:pageshadow="2"\n' +
49
+ ' inkscape:window-width="1280"\n' +
50
+ ' inkscape:window-height="737"\n' +
51
+ ' id="namedview4"\n' +
52
+ ' showgrid="false"\n' +
53
+ ' inkscape:zoom="0.39333333"\n' +
54
+ ' inkscape:cx="300"\n' +
55
+ ' inkscape:cy="300"\n' +
56
+ ' inkscape:window-x="-8"\n' +
57
+ ' inkscape:window-y="-8"\n' +
58
+ ' inkscape:window-maximized="1"\n' +
59
+ ' inkscape:current-layer="svg2" />\n' +
60
+ ' <image\n' +
61
+ ' width="600"\n' +
62
+ ' height="600"\n' +
63
+ ' preserveAspectRatio="none"\n' +
64
+ ' xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n' +
65
+ 'AAADsQAAA7EB9YPtSQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAhrSURB\n' +
66
+ 'VHic7d3fi1x3Gcfx97M7TdKYYNPYbLaxlVZrUaK1iviToiIpeNFIwQuLBW8UEQTv9C/wSvDS+yKo\n' +
67
+ 'CFopiFe2QVpqMKVYf0DaRmibZnfTRpNs9lez+3hxzq7T3ZnZmXO+3/PMmf284DDJzJznPGfOZ79n\n' +
68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4\n' +
93
+ 'lrsvJKwngZoKYMprzv6RsJYEGxhAM7vXzD6dYDkfT1Bj098T1pJgO94DlkesJ4EvAXeX930U+LW7\n' +
94
+ 'j3xqoLzm7MP12txy0d3/naiWjIF3BbAM32PsvBjzY8CdZvaEu4/6925PUu9zzW5/TFRHxsTWLri8\n' +
95
+ 'gvVx+l8JfBT4gZl9fsRlpLqy+DV3/1eiWjImut8DnqYY6QbpAI+a2eNmtn+34uWu+/4a/XXT6DeB\n' +
96
+ 'OgDlZeKfG2G+B4ATZvZbdz/f6wlmdj/F7jyFl/otR9rN3B0z+z5wb8Ual4CzwBvAMsWVxg9S7HpT\n' +
97
+ 'fPrxNvCzKgdAMv46Znac6uGD4tLu04n62e4m8ITCN7mmgLuimxjgyQpH3dIiHXZeqz8OHHjK3Z+P\n' +
98
+ 'bkTy6pDuHF0qDvzG3c9GNyL5TQEXopvosg78QuHbOzrAq9FNlK4Cv3L3l6MbkeZ03P2qmV1mhC+U\n' +
99
+ 'yeAcxQHHcmAPEmDzk5AzQcu/QXGa5ZcK395kxe9qg5mdAk41tNw14FngaXdfamiZMoa2AghgZl8H\n' +
100
+ 'vphxee9Q/E7G0+6+mHE50hLbA2jA14CHSHt6Zg54EfiLu9f5ZRuZMO8K4NadxdeHPUzx7UZVP8+9\n' +
101
+ 'TBG6F919vnKHMtF6BnDrQbNZ4LMU3yY1w84v7naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK\n' +
102
+ 'g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl\n' +
103
+ 'lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF\n' +
104
+ 'TkSuQmCC\n' +
105
+ '"\n' +
106
+ ' id="image10"\n' +
107
+ ' x="0"\n' +
108
+ ' y="0" />\n' +
109
+ ' <path\n' +
110
+ ' style="fill:#000000"\n' +
111
+ ' d="M 19.039097,494.38241 C 2.0018627,482.75861 -2.8301068,468.02182 5.0071177,451.587 8.2776829,444.72855 15.162733,436.35919 20.307229,432.98839 c 8.904129,-5.83422 9.948263,-5.67522 21.727331,3.30915 28.014638,21.3678 44.091105,18.882 51.54879,-7.97059 C 99.533959,406.9008 98.83533,123.18555 92.8125,115.28305 90.196335,111.85041 81.496733,108.63382 73.125,108.00381 58.734191,106.92084 58.077731,106.30388 56.961131,92.8125 L 55.797259,78.75 l 163.053411,0 163.05342,0 2.57381,11.71845 c 2.93006,13.34047 -1.71086,18.13302 -17.64754,18.22413 C 347.54041,108.80285 345,115.82292 345,169.01786 l 0,48.48214 67.5,0 67.5,0 0,-48.1688 c 0,-41.90267 -0.89209,-48.97614 -6.85778,-54.37499 C 469.37044,111.54279 462.75847,108.75 458.44894,108.75 443.44309,108.75 438.75,104.6341 438.75,91.473791 l 0,-12.723791 80.85139,0 80.85135,0 -1.16385,14.0625 c -1.13201,13.67745 -1.60515,14.09431 -17.27948,15.22432 -13.44982,0.96964 -16.73767,2.79799 -19.87627,11.0531 -5.80185,15.26002 -2.83763,249.42009 3.25016,256.74719 2.61705,3.14985 11.47643,6.80123 19.6875,8.11425 14.52533,2.32268 14.9292,2.79386 14.9292,17.41755 l 0,15.03026 -79.6875,-1.01208 -79.6875,-1.01209 -1.1367,-13.60684 c -1.13565,-13.59401 -1.11975,-13.60939 16.875,-16.30515 9.90645,-1.4841 19.25149,-4.64227 20.76679,-7.01816 1.5153,-2.37593 2.78092,-30.05423 2.8125,-61.50735 L 480,258.75 l -67.59289,0 -67.5929,0 1.0304,60.9375 1.03039,60.9375 19.6875,3.3399 c 20.4921,3.4764 22.16576,5.78036 17.32391,23.8476 -2.25337,8.40847 -2.53065,8.4375 -80.57378,8.4375 l -78.31263,0 0,-14.95567 c 0,-14.53673 0.41823,-15.02258 14.9292,-17.34297 8.21107,-1.31302 17.07044,-4.96657 19.6875,-8.11909 3.63727,-4.38139 4.7583,-35.56081 4.7583,-132.34294 0,-69.63615 -1.23091,-127.84279 -2.73535,-129.3481 -9.73748,-9.7431 -68.9232,-8.34789 -79.15408,1.86593 -3.08612,3.08097 -4.99292,46.77065 -6.52417,149.48557 -1.45514,97.60931 -3.64592,149.67975 -6.6905,159.01994 -13.55129,41.57292 -61.40288,74.9124 -111.000242,77.33685 -22.754302,1.11229 -28.166407,0.0821 -39.231561,-7.46711 z"\n' +
112
+ ' id="path3338"\n' +
113
+ ' inkscape:connector-curvature="0" />\n' +
114
+ '</svg>\n'
115
+
116
+ const imageCompressed = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"><image width="600" height="600" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAADsQAAA7EB9YPtSQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAhrSURB VHic7d3fi1x3Gcfx97M7TdKYYNPYbLaxlVZrUaK1iviToiIpeNFIwQuLBW8UEQTv9C/wSvDS+yKo CFopiFe2QVpqMKVYf0DaRmibZnfTRpNs9lez+3hxzq7T3ZnZmXO+3/PMmf284DDJzJznPGfOZ79n zpmzs+buiESZim5A9jYFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBKqU2dmM5spa2wAXk4bXf/vd7/3eQ6AbZumdvl/931T2+6b6rOODtzs 00Ov3gY+7u5uZr2W36+33R6fBt509/XBW6A3M9sPHAPWh1ynXe/bZR0HbYN+6zwF3KgVQOBbwGzN Gq1XbJfkfgJcqTjvXcD3EvaSax2fr7sL3p+kDemlzmvblu2yXwEcX3Ve233JushLARxjB2rMO/kB NLNpah7EyEB7YQQ8UGcE1OiXV50QtSWA+xTA8VUnRHV23026xap+N0y5Cz4GHAIO97i9GziYps+R rAGXgXlgobx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naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF TkSuQmCC"/><path d="M19.04 494.382C2.001 482.76-2.83 468.022 5.006 451.587c3.27-6.858 10.156-15.228 15.3-18.599 8.904-5.834 9.948-5.675 21.728 3.31 28.014 21.367 44.09 18.882 51.548-7.971 5.951-21.426 5.252-305.141-.77-313.044-2.617-3.433-11.316-6.65-19.688-7.28-14.39-1.082-15.047-1.7-16.164-15.19L55.797 78.75h326.107l2.574 11.718c2.93 13.34-1.711 18.133-17.648 18.225-19.29.11-21.83 7.13-21.83 60.325V217.5h135v-48.169c0-41.902-.892-48.976-6.858-54.375-3.772-3.413-10.384-6.206-14.693-6.206-15.006 0-19.699-4.116-19.699-17.276V78.75h161.703l-1.164 14.063c-1.132 13.677-1.605 14.094-17.28 15.224-13.45.97-16.737 2.798-19.876 11.053-5.802 15.26-2.837 249.42 3.25 256.747 2.617 3.15 11.477 6.801 19.688 8.114C599.596 386.274 600 386.745 600 401.37v15.03l-79.687-1.012-79.688-1.012-1.137-13.607c-1.135-13.594-1.12-13.61 16.875-16.305 9.907-1.484 19.252-4.642 20.767-7.018 1.515-2.376 2.781-30.054 2.813-61.508L480 258.75H344.814l1.03 60.938 1.031 60.937 19.688 3.34c20.492 3.476 22.165 5.78 17.323 23.848-2.253 8.408-2.53 8.437-80.573 8.437H225v-14.956c0-14.536.418-15.022 14.93-17.343 8.21-1.313 17.07-4.966 19.687-8.119 3.637-4.381 4.758-35.56 4.758-132.343 0-69.636-1.23-127.842-2.735-129.348-9.738-9.743-68.924-8.348-79.154 1.866-3.087 3.081-4.993 46.77-6.525 149.486-1.455 97.609-3.646 149.68-6.69 159.02-13.551 41.573-61.403 74.912-111 77.337-22.755 1.112-28.167.082-39.232-7.468z"/></svg>'
117
+
118
+ beforeEach(setUp.beforeEach)
119
+
120
+ afterEach(setUp.afterEach)
121
+
122
+ describe('imagesFor', () => {
123
+ test('copies the images directory and moves the optimized images', done => {
124
+ const srcPath = gulpConfig.get('srcPath')
125
+ const imagesFile = `${srcPath}/imageToCopy.svg`
126
+ fs.writeFileSync(imagesFile, imageContents)
127
+ expect.assertions(3)
128
+ const oldContents = fs.readFileSync(imagesFile).toString()
129
+ expect(oldContents).toEqual(imageContents)
130
+ const browserPath = gulpConfig.get('browser.to')
131
+ imagesFor(imagesFile, browserPath)
132
+ .on('finish', () => {
133
+ expect(fs.existsSync(browserPath)).toBeTruthy()
134
+ const movedContents = fs.readFileSync(`${browserPath}/imageToCopy.svg`).toString()
135
+ expect(movedContents).toEqual(imageCompressed)
136
+ done()
137
+ })
138
+ .on('error', error => {
139
+ console.error('Encountered error', error)
140
+ done()
141
+ })
142
+ })
143
+ })
@@ -4,7 +4,6 @@ const rename = require('gulp-rename')
4
4
 
5
5
  /**
6
6
  * Minify files and rename the output with '.min' extension.
7
- * @function
8
7
  * @memberOf module:partials
9
8
  * @returns {*}
10
9
  */
@@ -3,7 +3,7 @@ const setUp = require('../test-helpers/setUp')
3
3
  setUp.setDefaults('test-minify-for')
4
4
  const gulpConfig = setUp.gulpConfig
5
5
  const minifyFor = require('./minifyFor')
6
- const { countMatches } = require('../testHelpers')
6
+ const { countMatches } = require('test-filesystem')
7
7
 
8
8
  const rawContents = 'const { dest, src } = require(\'gulp\')\n' +
9
9
  'const { default: uglify } = require(\'gulp-uglify-es\')\n' +
@@ -4,12 +4,11 @@ const rename = require('gulp-rename')
4
4
 
5
5
  /**
6
6
  * Copy a readme template into the README.md file.
7
- * @function
8
7
  * @memberOf module:partials
9
8
  * @returns {*}
10
9
  */
11
- const readmeTemplate = () => src(gulpConfig.get('readmeTemplate'))
12
- .pipe(rename(gulpConfig.get('readmeFile')))
13
- .pipe(dest(gulpConfig.get('readmePath')))
10
+ const readmeTemplate = () => src(gulpConfig.get('readme.template'))
11
+ .pipe(rename(gulpConfig.get('readme.file')))
12
+ .pipe(dest(gulpConfig.get('readme.to')))
14
13
 
15
14
  module.exports = readmeTemplate
@@ -5,7 +5,7 @@ const gulpConfig = setUp.gulpConfig
5
5
  const readmeTemplate = require('./readmeTemplate')
6
6
 
7
7
  const mainMd = 'MAIN.md'
8
- const mainTestPath = gulpConfig.get('readmeTemplate')
8
+ const mainTestPath = gulpConfig.get('readme.template')
9
9
 
10
10
  beforeEach(() => setUp.beforeEach()
11
11
  .then(() => fs.copyFileSync(mainMd, mainTestPath)))
@@ -14,7 +14,7 @@ afterEach(setUp.afterEach)
14
14
 
15
15
  describe('readmeTemplate', () => {
16
16
  test('copies the main contents into the new README.md', done => {
17
- const readmeFilePath = gulpConfig.get('readmePath') + gulpConfig.get('readmeFile')
17
+ const readmeFilePath = gulpConfig.get('readme.to') + gulpConfig.get('readme.file')
18
18
  const mainContents = fs.readFileSync(mainTestPath)
19
19
  expect.assertions(2)
20
20
  readmeTemplate()
@@ -2,7 +2,6 @@ const { rm, exists } = require('fs')
2
2
 
3
3
  /**
4
4
  * Return a promise to be completed once the specified directory is deleted.
5
- * @function
6
5
  * @memberOf module:partials
7
6
  * @param {string} dirPath
8
7
  * @returns {Promise<*>}
@@ -25,14 +25,13 @@ const testQuick = require('../testQuick')
25
25
  *
26
26
  * // The resulting replaced path for the destination folder
27
27
  * distPathResult = 'dist/some/path/'
28
- * @function
29
28
  * @memberOf module:partials
30
29
  * @param {string} path
31
30
  * @returns {stream.Stream}
32
31
  */
33
32
  const runOnChange = path => {
34
- const useTs = gulpConfig.get('useTsConfig')
35
- const distPath = gulpConfig.get('distPath')
33
+ const useTs = gulpConfig.get('typescript.enabled')
34
+ const distPath = gulpConfig.get('dist.to')
36
35
  const srcPath = gulpConfig.get('srcPath')
37
36
  /**
38
37
  * 1. The original path comes in from src and is a .ts
@@ -49,9 +48,9 @@ const runOnChange = path => {
49
48
  distSrcPath = path.replace(pathRegex, `${distPath}$1$2.js`)
50
49
  }
51
50
  const runSeries = distSeries(distSrcPath, distPathResult, path)
52
- return gulpConfig.get('nodeOnly')
53
- ? series(testQuick, runSeries)()
54
- : parallel(testQuick, series(runSeries, bundle))()
51
+ return gulpConfig.get('browser.enabled')
52
+ ? parallel(testQuick, series(runSeries, bundle))()
53
+ : series(testQuick, runSeries)()
55
54
  }
56
55
 
57
56
  module.exports = runOnChange
@@ -19,7 +19,7 @@ const rawContents = 'export function sayHello(name: string) {\n' +
19
19
  ' return `Hello from ${name}`;\n' +
20
20
  '}'
21
21
 
22
- const distPath = gulpConfig.get('distPath') + '/'
22
+ const distPath = gulpConfig.get('dist.to') + '/'
23
23
  const srcPath = gulpConfig.get('srcPath')
24
24
  const srcFile = `${srcPath}/runOnChange.js`
25
25
  const srcTsFile = `${srcPath}/runOnChange.ts`
@@ -38,8 +38,8 @@ afterEach(() => {
38
38
 
39
39
  describe('runOnChange', () => {
40
40
  test('runs testQuick and distFor for nodeOnly true and useTs false', done => {
41
- gulpConfig.set('nodeOnly', true)
42
- gulpConfig.set('useTsConfig', false)
41
+ gulpConfig.set('browser.enabled', false)
42
+ gulpConfig.set('typescript.enabled', false)
43
43
  expect.assertions(2)
44
44
  runOnChange(srcFile)
45
45
  setTimeout(() => {
@@ -50,8 +50,8 @@ describe('runOnChange', () => {
50
50
  })
51
51
 
52
52
  test('runs testQuick and distFor for nodeOnly true and tsFor for useTs true', done => {
53
- gulpConfig.set('nodeOnly', true)
54
- gulpConfig.set('useTsConfig', true)
53
+ gulpConfig.set('browser.enabled', false)
54
+ gulpConfig.set('typescript.enabled', true)
55
55
  const distSrcPath = distPath + 'runOnChange.js'
56
56
  expect.assertions(3)
57
57
  runOnChange(srcTsFile)
@@ -64,8 +64,8 @@ describe('runOnChange', () => {
64
64
  })
65
65
 
66
66
  test('runs testQuick and distFor then bundle for nodeOnly false and useTs false', done => {
67
- gulpConfig.set('nodeOnly', false)
68
- gulpConfig.set('useTsConfig', false)
67
+ gulpConfig.set('browser.enabled', true)
68
+ gulpConfig.set('typescript.enabled', false)
69
69
  expect.assertions(3)
70
70
  runOnChange(srcFile)
71
71
  setTimeout(() => {
@@ -77,8 +77,8 @@ describe('runOnChange', () => {
77
77
  })
78
78
 
79
79
  test('runs testQuick and distFor then bundle for nodeOnly false and tsFor for useTs true', done => {
80
- gulpConfig.set('nodeOnly', false)
81
- gulpConfig.set('useTsConfig', true)
80
+ gulpConfig.set('browser.enabled', true)
81
+ gulpConfig.set('typescript.enabled', true)
82
82
  const distSrcPath = distPath + 'runOnChange.js'
83
83
  expect.assertions(4)
84
84
  runOnChange(srcTsFile)
@@ -6,13 +6,12 @@ const sass = require('gulp-sass')(require('sass'))
6
6
 
7
7
  /**
8
8
  * Build the CSS for a given source pattern.
9
- * @function
10
9
  * @memberOf module:partials
11
10
  * @param {string|array} [srcSearch='src/config/path/sass/for']
12
11
  * @param {string} [cssPath='css/config/path']
13
12
  * @returns {stream.Stream}
14
13
  */
15
- const sassFor = (srcSearch = gulpConfig.get('sassSearch'), cssPath = gulpConfig.get('cssPath')) => src(srcSearch)
14
+ const sassFor = (srcSearch = gulpConfig.get('sass.from'), cssPath = gulpConfig.get('sass.to')) => src(srcSearch)
16
15
  .pipe(sass().on('error', sass.logError)) // Passes it through a gulp-sass, log errors to console
17
16
  .pipe(dest(cssPath))
18
17
  .pipe(cssnano())
@@ -3,7 +3,7 @@ const setUp = require('../test-helpers/setUp')
3
3
  setUp.setDefaults('test-sass-for')
4
4
  const gulpConfig = setUp.gulpConfig
5
5
  const sassFor = require('./sassFor')
6
- const { countMatches, logObject } = require('../testHelpers')
6
+ const { countMatches } = require('test-filesystem')
7
7
 
8
8
  const sassContents = 'html\n' +
9
9
  ' font-size: 62.5%\n' +
@@ -24,7 +24,7 @@ const sassContents = 'html\n' +
24
24
  ' outline: none\n' +
25
25
  ' text-decoration: none'
26
26
 
27
- const sassPath = gulpConfig.get('sassPath')
27
+ const sassPath = gulpConfig.get('sass.path')
28
28
 
29
29
  beforeEach(() => {
30
30
  setUp.beforeEach()
@@ -43,7 +43,7 @@ describe('sassFor', () => {
43
43
  expect(countMatches(oldContents, ' {')).toEqual(0)
44
44
  expect(countMatches(oldContents, '\n' +
45
45
  ' }')).toEqual(0)
46
- const cssPath = gulpConfig.get('cssPath')
46
+ const cssPath = gulpConfig.get('sass.to')
47
47
  sassFor(sassFile)
48
48
  .on('finish', () => {
49
49
  expect(fs.existsSync(cssPath)).toBeTruthy()
@@ -4,16 +4,15 @@ const ts = require('gulp-typescript')
4
4
 
5
5
  /**
6
6
  * Starting at the source directory, find all the ts files and convert them into the distribution directory.
7
- * @function
8
7
  * @memberOf module:partials
9
8
  * @param {string|array} [srcPath='']
10
9
  * @param {string} [distPath='']
11
10
  * @returns {Function}
12
11
  * @see `https://www.typescriptlang.org/docs/handbook/gulp.html` for more info
13
12
  */
14
- const tsFor = (srcPath = gulpConfig.get('tsSearch'), distPath = gulpConfig.get('distPath')) => {
15
- const declarationProject = ts.createProject(gulpConfig.get('useTsConfig'))
16
- const tsProject = ts.createProject(gulpConfig.get('useTsConfig'))
13
+ const tsFor = (srcPath = gulpConfig.get('typescript.from'), distPath = gulpConfig.get('typescript.to')) => {
14
+ const declarationProject = ts.createProject(gulpConfig.get('typescript.config'))
15
+ const tsProject = ts.createProject(gulpConfig.get('typescript.config'))
17
16
  const makeDeclarations = () => src(srcPath).pipe(declarationProject()).dts.pipe(dest(distPath))
18
17
  const compileJS = () => src(srcPath).pipe(tsProject()).js.pipe(dest(distPath))
19
18
  return parallel(makeDeclarations, compileJS)
@@ -3,7 +3,7 @@ const setUp = require('../test-helpers/setUp')
3
3
  setUp.setDefaults('test-ts-for')
4
4
  const gulpConfig = setUp.gulpConfig
5
5
  const tsFor = require('./tsFor')
6
- const { countMatches, logObject } = require('../testHelpers')
6
+ const { countMatches } = require('test-filesystem')
7
7
 
8
8
  const rawContents = 'export function sayHello(name: string) {\n' +
9
9
  ' return `Hello from ${name}`;\n' +
@@ -23,7 +23,7 @@ afterEach(setUp.afterEach)
23
23
 
24
24
  describe('tsFor', () => {
25
25
  test('copies the src directory and compiles it into the dist directory', done => {
26
- const distPath = gulpConfig.get('distPath')
26
+ const distPath = gulpConfig.get('typescript.to')
27
27
  const srcPath = gulpConfig.get('srcPath')
28
28
  const srcFile = `${srcPath}/typeScript.ts`
29
29
  expect.assertions(3)
@@ -2,7 +2,7 @@
2
2
  * Micro-functions used as components for the main gulp functions.
3
3
  * @file
4
4
  * @author Joshua Heagle <joshuaheagle@gmail.com>
5
- * @version 2.0.0
5
+ * @version 3.0.0
6
6
  * @module partials
7
7
  * @memberOf module:js-build-tools
8
8
  */
@@ -10,9 +10,11 @@
10
10
  const addToReadme = require('./partials/addToReadme')
11
11
  const beginWatcher = require('./partials/beginWatcher')
12
12
  const clean = require('./partials/clean')
13
+ const copyFor = require('./partials/copyFor')
13
14
  const distFor = require('./partials/distFor')
14
15
  const distForSrc = require('./partials/distForSrc')
15
16
  const distSeries = require('./partials/distSeries')
17
+ const imagesFor = require('./partials/imagesFor.js')
16
18
  const minifyFor = require('./partials/minifyFor')
17
19
  const readmeTemplate = require('./partials/readmeTemplate')
18
20
  const removeDirectory = require('./partials/removeDirectory')
@@ -24,9 +26,11 @@ module.exports = {
24
26
  addToReadme,
25
27
  beginWatcher,
26
28
  clean,
29
+ copyFor,
27
30
  distFor,
28
31
  distForSrc,
29
32
  distSeries,
33
+ imagesFor,
30
34
  minifyFor,
31
35
  readmeTemplate,
32
36
  removeDirectory,
@@ -2,6 +2,6 @@ const partials = require('./partials')
2
2
 
3
3
  describe('partials', () => {
4
4
  test('is object with all partial exports', () => {
5
- expect(Object.keys(partials).length).toBe(12)
5
+ expect(Object.keys(partials).length).toBe(14)
6
6
  })
7
7
  })
@@ -6,7 +6,7 @@ const sass = require('./sass')
6
6
 
7
7
  beforeEach(() => setUp.beforeEach().then(
8
8
  () => {
9
- const sassPath = gulpConfig.get('sassPath')
9
+ const sassPath = gulpConfig.get('sass.path')
10
10
  return fs.mkdirSync(sassPath, { recursive: true })
11
11
  }
12
12
  ))
@@ -15,7 +15,7 @@ afterEach(setUp.afterEach)
15
15
 
16
16
  describe('sass', () => {
17
17
  test('uses the configured paths', done => {
18
- const sassPath = gulpConfig.get('sassPath')
18
+ const sassPath = gulpConfig.get('sass.path')
19
19
  expect.assertions(1)
20
20
  sass()
21
21
  .on('finish', () => {
@@ -1,39 +1,43 @@
1
- const fs = require('fs')
2
- // Import the configurations and override some of them in order to direct to the temp directory.
1
+ // Import the configurations and override some of them to direct to the temp directory.
3
2
  const gulpConfig = require('../../gulp.config.js')
4
- const { removeDirectory } = require('../partials')
3
+ const { setUp } = require('test-filesystem')
5
4
 
6
5
  let tempDir = 'test-temp/'
7
6
  let srcPath = `${tempDir}src`
8
7
 
9
8
  /**
10
9
  * Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
11
- * @function
12
10
  * @memberOf module:testHelpers
13
11
  * @param {string} testDir
14
12
  */
15
13
  const setDefaults = (testDir = 'test-temp') => {
16
14
  tempDir = `${testDir}/`
17
15
  srcPath = `${tempDir}src`
16
+ setUp.setDefaults(tempDir)
18
17
  const distPath = `${tempDir}dist`
19
18
  const browserPath = `${tempDir}browser`
20
19
  const sassPath = `${tempDir}sass`
21
- gulpConfig.set('browserPath', browserPath)
20
+ gulpConfig.set('browser.from', `${distPath}/**/*.js`)
21
+ gulpConfig.set('browser.to', browserPath)
22
22
  gulpConfig.set('cleanPaths', [distPath, browserPath])
23
- gulpConfig.set('cssPath', `${browserPath}/css`)
24
- gulpConfig.set('distMain', `${distPath}/main`)
25
- gulpConfig.set('distPath', distPath)
26
- gulpConfig.set('distSearch', `${distPath}/**/*.js`)
27
- gulpConfig.set('readmeTemplate', `${tempDir}MAIN.md`)
28
- gulpConfig.set('readmePath', tempDir)
29
- gulpConfig.set('readmeSearch', `${srcPath}/**/!(*.test).js`)
23
+ gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`)
24
+ gulpConfig.set('dist.main', `${distPath}/main`)
25
+ gulpConfig.set('dist.to', distPath)
26
+ gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`)
27
+ gulpConfig.set('fonts.to', `${browserPath}/fonts`)
28
+ gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`)
29
+ gulpConfig.set('images.to', `${browserPath}/img`)
30
+ gulpConfig.set('readme.template', `${tempDir}MAIN.md`)
31
+ gulpConfig.set('readme.to', tempDir)
32
+ gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`)
30
33
  gulpConfig.set('rootPath', tempDir)
31
- gulpConfig.set('sassPath', sassPath)
32
- gulpConfig.set('sassSearch', `${sassPath}/**/*.+(scss|sass)`)
34
+ gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`)
35
+ gulpConfig.set('sass.path', sassPath)
36
+ gulpConfig.set('sass.to', `${browserPath}/css`)
33
37
  gulpConfig.set('srcPath', srcPath)
34
- gulpConfig.set('srcSearch', `${srcPath}/**/!(*.test).js`)
35
- gulpConfig.set('tsSearch', `${srcPath}/**/*.ts`)
36
- gulpConfig.set('watchSearch', `${srcPath}/**/*.js`)
38
+ gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`)
39
+ gulpConfig.set('typescript.to', distPath)
40
+ gulpConfig.set('test.watch', `${srcPath}/**/*.js`)
37
41
  }
38
42
 
39
43
  exports.setDefaults = setDefaults
@@ -42,34 +46,22 @@ exports.gulpConfig = gulpConfig
42
46
 
43
47
  /**
44
48
  * Ensure that the del has completed, recursively attempt to delete and recreate
45
- * @function
46
49
  * @memberOf module:testHelpers
47
50
  * @param {boolean} [exists=true]
48
51
  * @returns {Promise<*|void>}
49
52
  */
50
- const createTempDir = async (exists = true) => {
51
- if (exists) {
52
- return removeDirectory(tempDir)
53
- .then(removedDir => createTempDir(fs.existsSync(removedDir)))
54
- .catch(error => console.error('Error: ', error))
55
- }
56
- return fs.mkdirSync(srcPath, { recursive: true })
57
- }
58
-
59
- exports.createTempDir = createTempDir
53
+ exports.createTempDir = setUp.createTempDir
60
54
 
61
55
  /**
62
56
  * In the Jest.beforeEach function call this one to set up the temp directory.
63
- * @function
64
57
  * @memberOf module:testHelpers
65
58
  * @returns {Promise<*|void>}
66
59
  */
67
- exports.beforeEach = () => createTempDir()
60
+ exports.beforeEach = setUp.beforeEach
68
61
 
69
62
  /**
70
63
  * In the Jest.afterEach function call this one to clean up and remove the temp directory.
71
- * @function
72
64
  * @memberOf module:testHelpers
73
65
  * @returns {Promise<*>}
74
66
  */
75
- exports.afterEach = () => removeDirectory(tempDir)
67
+ exports.afterEach = setUp.afterEach
@@ -4,17 +4,16 @@ const { runCLI } = require('jest')
4
4
  /**
5
5
  * Run all tests with jest.
6
6
  * Configure where tests are located by using 'testPath'.
7
- * @function
8
7
  * @memberOf module:js-build-tools
9
8
  * @returns {Promise<*>}
10
9
  */
11
10
  const testFull = () => {
12
- let testPath = gulpConfig.get('testPath')
11
+ let testPath = gulpConfig.get('test.path')
13
12
  if (!Array.isArray(testPath)) {
14
13
  // The testPath must be an array of strings
15
14
  testPath = [testPath]
16
15
  }
17
- return runCLI(gulpConfig.get('testOptions'), testPath)
16
+ return runCLI(gulpConfig.get('test.options'), testPath)
18
17
  }
19
18
 
20
19
  module.exports = testFull
@@ -11,6 +11,6 @@ describe('testFull', () => {
11
11
  test('runs the Jest CLI with the configured options', () => {
12
12
  expect.assertions(1)
13
13
  testFull()
14
- expect(runCLI).toHaveBeenCalledWith(gulpConfig.get('testOptions'), [gulpConfig.get('testPath')])
14
+ expect(runCLI).toHaveBeenCalledWith(gulpConfig.get('test.options'), [gulpConfig.get('test.path')])
15
15
  })
16
16
  })
@@ -1,32 +1,15 @@
1
1
  /**
2
- * An assortment of objects that can be used in tests and some functions to help debug and write tests.
2
+ * Export the setUp helper.
3
3
  * @file
4
4
  * @author Joshua Heagle <joshuaheagle@gmail.com>
5
- * @version 2.0.0
5
+ * @version 3.0.0
6
6
  * @module testHelpers
7
7
  * @memberOf module:js-build-tools
8
8
  */
9
9
 
10
- const circularObject = require('./test-helpers/circularObject')
11
- const countMatches = require('./test-helpers/countMatches')
12
- const deepReferenceObject = require('./test-helpers/deepReferenceObject')
13
- const domItem = require('./test-helpers/domItem')
14
- const jsonDom = require('./test-helpers/jsonDom')
15
- const linkedList = require('./test-helpers/linkedList')
16
- const logObject = require('./test-helpers/logObject')
17
- const multiReferenceObject = require('./test-helpers/multiReferenceObject')
18
- const nodeTree = require('./test-helpers/nodeTree')
10
+
19
11
  const setUp = require('./test-helpers/setUp')
20
12
 
21
13
  module.exports = {
22
- circularObject,
23
- countMatches,
24
- deepReferenceObject,
25
- domItem,
26
- jsonDom,
27
- linkedList,
28
- logObject,
29
- multiReferenceObject,
30
- nodeTree,
31
14
  setUp,
32
15
  }
@@ -2,6 +2,6 @@ const testHelpers = require('./testHelpers')
2
2
 
3
3
  describe('testHelpers', () => {
4
4
  test('is object with all helper exports', () => {
5
- expect(Object.keys(testHelpers).length).toBe(10)
5
+ expect(Object.keys(testHelpers).length).toBe(1)
6
6
  })
7
7
  })
@@ -4,12 +4,11 @@ const { runCLI } = require('jest')
4
4
  /**
5
5
  * Run the Jest tests for files which have been modified (based on git status).
6
6
  * Configure where tests are located by using 'testPath'.
7
- * @function
8
7
  * @memberOf module:js-build-tools
9
8
  * @returns {Promise<*>}
10
9
  */
11
10
  const testQuick = () => {
12
- let testPath = gulpConfig.get('testPath')
11
+ let testPath = gulpConfig.get('test.path')
13
12
  if (!Array.isArray(testPath)) {
14
13
  // The testPath must be an array of strings
15
14
  testPath = [testPath]
@@ -11,6 +11,6 @@ describe('testQuick', () => {
11
11
  test('runs the jest CLI with onlyChanged option', () => {
12
12
  expect.assertions(1)
13
13
  testQuick()
14
- expect(runCLI).toHaveBeenCalledWith({ onlyChanged: true }, [gulpConfig.get('testPath')])
14
+ expect(runCLI).toHaveBeenCalledWith({ onlyChanged: true }, [gulpConfig.get('test.path')])
15
15
  })
16
16
  })