html-snapshots 1.3.2 → 1.5.0

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 (253) hide show
  1. package/lib/common/index.js +57 -3
  2. package/lib/common/sitemap/sitemap-collection.js +3 -2
  3. package/lib/common/sitemap/sitemap-index.js +1 -4
  4. package/lib/common/sitemap/sitemap.js +15 -13
  5. package/lib/html-snapshots.js +5 -6
  6. package/lib/input-generators/_base.js +5 -5
  7. package/package.json +5 -6
  8. package/.c8rc.json +0 -5
  9. package/.eslintignore +0 -5
  10. package/.eslintrc.json +0 -16
  11. package/.github/issue_template.md +0 -16
  12. package/.github/workflows/verify.yml +0 -32
  13. package/docs/example-heroku-redis.md +0 -43
  14. package/docs/notes.md +0 -42
  15. package/examples/README.md +0 -149
  16. package/examples/custom/README.md +0 -22
  17. package/examples/custom/myFilter.js +0 -22
  18. package/examples/custom/package-lock.json +0 -2804
  19. package/examples/custom/package.json +0 -12
  20. package/examples/custom/snapshot.js +0 -28
  21. package/examples/debug-phantomjs/README.md +0 -38
  22. package/examples/debug-phantomjs/package-lock.json +0 -2922
  23. package/examples/debug-phantomjs/package.json +0 -12
  24. package/examples/debug-phantomjs/snapshot.js +0 -60
  25. package/examples/debug-puppeteer/README.md +0 -18
  26. package/examples/debug-puppeteer/package-lock.json +0 -2804
  27. package/examples/debug-puppeteer/package.json +0 -12
  28. package/examples/debug-puppeteer/snapshot.js +0 -30
  29. package/examples/html5rocks/README.md +0 -22
  30. package/examples/html5rocks/package-lock.json +0 -3218
  31. package/examples/html5rocks/package.json +0 -12
  32. package/examples/html5rocks/snapshot.js +0 -59
  33. package/examples/process-limit/README.md +0 -24
  34. package/examples/process-limit/package-lock.json +0 -2830
  35. package/examples/process-limit/package.json +0 -12
  36. package/examples/process-limit/snapshot.js +0 -30
  37. package/examples/simple-promise/README.md +0 -20
  38. package/examples/simple-promise/package-lock.json +0 -2830
  39. package/examples/simple-promise/package.json +0 -12
  40. package/examples/simple-promise/snapshot.js +0 -30
  41. package/examples/sitemap-index/README.md +0 -20
  42. package/examples/sitemap-index/package-lock.json +0 -2830
  43. package/examples/sitemap-index/package.json +0 -12
  44. package/examples/sitemap-index/snapshot.js +0 -34
  45. package/examples/verbose/README.md +0 -22
  46. package/examples/verbose/package-lock.json +0 -2805
  47. package/examples/verbose/package.json +0 -12
  48. package/examples/verbose/snapshot.js +0 -34
  49. package/test/helpers/options.js +0 -55
  50. package/test/helpers/result.js +0 -32
  51. package/test/helpers/sitemap.js +0 -130
  52. package/test/mocha/async/test.js +0 -416
  53. package/test/mocha/browsers/puppeteer.js +0 -129
  54. package/test/mocha/browsers/server/index.html +0 -9
  55. package/test/mocha/browsers/test.js +0 -11
  56. package/test/mocha/common/helpers.js +0 -87
  57. package/test/mocha/common/test.js +0 -188
  58. package/test/mocha/html-snapshots/basics.js +0 -88
  59. package/test/mocha/html-snapshots/myFilter.js +0 -10
  60. package/test/mocha/html-snapshots/phantomjs-options.js +0 -156
  61. package/test/mocha/html-snapshots/process-limit.js +0 -156
  62. package/test/mocha/html-snapshots/puppeteer.js +0 -47
  63. package/test/mocha/html-snapshots/robots.js +0 -194
  64. package/test/mocha/html-snapshots/server/contact/index.html +0 -57
  65. package/test/mocha/html-snapshots/server/favicon.ico +0 -0
  66. package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.eot +0 -0
  67. package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.svg +0 -220
  68. package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.ttf +0 -0
  69. package/test/mocha/html-snapshots/server/fonts/facebolf-webfont.woff +0 -0
  70. package/test/mocha/html-snapshots/server/images/ajax-loader.gif +0 -0
  71. package/test/mocha/html-snapshots/server/images/art1.jpg +0 -0
  72. package/test/mocha/html-snapshots/server/images/carpet.jpg +0 -0
  73. package/test/mocha/html-snapshots/server/images/carpets/carpet1.jpg +0 -0
  74. package/test/mocha/html-snapshots/server/images/carpets/carpet1_th.jpg +0 -0
  75. package/test/mocha/html-snapshots/server/images/carpets/carpet2.jpg +0 -0
  76. package/test/mocha/html-snapshots/server/images/carpets/carpet2_th.jpg +0 -0
  77. package/test/mocha/html-snapshots/server/images/carpets/carpet3.jpg +0 -0
  78. package/test/mocha/html-snapshots/server/images/carpets/carpet3_th.jpg +0 -0
  79. package/test/mocha/html-snapshots/server/images/carpets/carpet4.jpg +0 -0
  80. package/test/mocha/html-snapshots/server/images/carpets/carpet4_th.jpg +0 -0
  81. package/test/mocha/html-snapshots/server/images/floor.jpg +0 -0
  82. package/test/mocha/html-snapshots/server/images/foundation/orbit/bullets.jpg +0 -0
  83. package/test/mocha/html-snapshots/server/images/foundation/orbit/left-arrow-small.png +0 -0
  84. package/test/mocha/html-snapshots/server/images/foundation/orbit/left-arrow.png +0 -0
  85. package/test/mocha/html-snapshots/server/images/foundation/orbit/loading.gif +0 -0
  86. package/test/mocha/html-snapshots/server/images/foundation/orbit/mask-black.png +0 -0
  87. package/test/mocha/html-snapshots/server/images/foundation/orbit/pause-black.png +0 -0
  88. package/test/mocha/html-snapshots/server/images/foundation/orbit/right-arrow-small.png +0 -0
  89. package/test/mocha/html-snapshots/server/images/foundation/orbit/right-arrow.png +0 -0
  90. package/test/mocha/html-snapshots/server/images/foundation/orbit/rotator-black.png +0 -0
  91. package/test/mocha/html-snapshots/server/images/foundation/orbit/timer-black.png +0 -0
  92. package/test/mocha/html-snapshots/server/images/home-sprite/certification.png +0 -0
  93. package/test/mocha/html-snapshots/server/images/home-sprite/cleantrust.png +0 -0
  94. package/test/mocha/html-snapshots/server/images/home-sprite/institute.png +0 -0
  95. package/test/mocha/html-snapshots/server/images/home-sprite-s1a48fdbd81.png +0 -0
  96. package/test/mocha/html-snapshots/server/images/logo-300.png +0 -0
  97. package/test/mocha/html-snapshots/server/images/slider1-lg.jpg +0 -0
  98. package/test/mocha/html-snapshots/server/images/slider1.jpg +0 -0
  99. package/test/mocha/html-snapshots/server/index.css +0 -1
  100. package/test/mocha/html-snapshots/server/index.html +0 -57
  101. package/test/mocha/html-snapshots/server/nojq/index.html +0 -46
  102. package/test/mocha/html-snapshots/server/pjsopts/index.html +0 -55
  103. package/test/mocha/html-snapshots/server/public/page-sitemap.xml +0 -16
  104. package/test/mocha/html-snapshots/server/public/wordpress/category-sitemap.xml +0 -13
  105. package/test/mocha/html-snapshots/server/public/wordpress/page-sitemap.xml +0 -16
  106. package/test/mocha/html-snapshots/server/public/wordpress/post-sitemap.xml +0 -27
  107. package/test/mocha/html-snapshots/server/public/wordpress/post_tag-sitemap.xml +0 -17
  108. package/test/mocha/html-snapshots/server/public/wordpress/product-sitemap.xml +0 -13
  109. package/test/mocha/html-snapshots/server/public/wordpress-2/category-sitemap.xml +0 -13
  110. package/test/mocha/html-snapshots/server/public/wordpress-2/page-sitemap.xml +0 -16
  111. package/test/mocha/html-snapshots/server/public/wordpress-2/post-sitemap.xml +0 -27
  112. package/test/mocha/html-snapshots/server/public/wordpress-2/post_tag-sitemap.xml +0 -17
  113. package/test/mocha/html-snapshots/server/public/wordpress-2/product-sitemap.xml +0 -13
  114. package/test/mocha/html-snapshots/server/require.js +0 -1
  115. package/test/mocha/html-snapshots/server/services/carpets/index.html +0 -57
  116. package/test/mocha/html-snapshots/server/test_robots.txt +0 -13
  117. package/test/mocha/html-snapshots/server/test_robots_sitemap.txt +0 -15
  118. package/test/mocha/html-snapshots/server/test_robots_sitemap.xml +0 -22
  119. package/test/mocha/html-snapshots/server/test_sitemap_index-2.xml +0 -25
  120. package/test/mocha/html-snapshots/server/test_sitemap_index-3.xml +0 -25
  121. package/test/mocha/html-snapshots/server/test_sitemap_index.xml +0 -25
  122. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/custom-validity.js +0 -1
  123. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/modernizr-custom.js +0 -1
  124. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/extras/mousepress.js +0 -1
  125. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/polyfiller.js +0 -1
  126. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/canvas2png.js +0 -1
  127. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/flashcanvas.js +0 -1
  128. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/flashcanvas.swf +0 -0
  129. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/proxy.php +0 -73
  130. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvas/save.php +0 -49
  131. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/canvas2png.js +0 -1
  132. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  133. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  134. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/flashcanvas.js +0 -1
  135. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/proxy.php +0 -73
  136. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/FlashCanvasPro/save.php +0 -49
  137. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/1.js +0 -1
  138. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/10.js +0 -1
  139. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/11.js +0 -1
  140. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/12.js +0 -1
  141. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/13.js +0 -1
  142. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/14.js +0 -1
  143. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/15.js +0 -1
  144. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/16.js +0 -1
  145. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/17.js +0 -1
  146. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/18.js +0 -1
  147. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/19.js +0 -1
  148. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/2.js +0 -1
  149. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/20.js +0 -1
  150. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/21.js +0 -1
  151. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/22.js +0 -1
  152. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/23.js +0 -1
  153. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/24.js +0 -1
  154. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/25.js +0 -1
  155. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/26.js +0 -1
  156. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/27.js +0 -1
  157. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/3.js +0 -1
  158. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/4.js +0 -1
  159. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/5.js +0 -1
  160. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/59.js +0 -1
  161. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/6.js +0 -1
  162. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/7.js +0 -1
  163. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/8.js +0 -1
  164. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/combos/9.js +0 -1
  165. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/details.js +0 -1
  166. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/dom-extend.js +0 -1
  167. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/es5.js +0 -1
  168. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/excanvas.js +0 -1
  169. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-core.js +0 -1
  170. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-datalist.js +0 -1
  171. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-message.js +0 -1
  172. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-native-extend.js +0 -1
  173. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-number-date-api.js +0 -1
  174. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-number-date-ui.js +0 -1
  175. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/form-shim-extend.js +0 -1
  176. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/geolocation.js +0 -1
  177. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ar.js +0 -1
  178. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ch-ZN.js +0 -1
  179. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-de.txt +0 -33
  180. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-el.js +0 -1
  181. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-en.txt +0 -34
  182. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-es.js +0 -1
  183. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-fr.js +0 -1
  184. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-he.js +0 -1
  185. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-hi.js +0 -1
  186. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-hu.js +0 -1
  187. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-it.js +0 -1
  188. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ja.js +0 -1
  189. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-nl.js +0 -1
  190. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-pt-PT.js +0 -1
  191. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-ru.js +0 -1
  192. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/i18n/errormessages-sv.js +0 -1
  193. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/json-storage.js +0 -1
  194. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/license.txt +0 -1
  195. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/player.swf +0 -0
  196. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/jwplayer/readme.html +0 -87
  197. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-core.js +0 -1
  198. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-jaris.js +0 -1
  199. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-native-fix.js +0 -1
  200. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-swf.js +0 -1
  201. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/mediaelement-yt.js +0 -1
  202. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/details-arrows.png +0 -0
  203. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/forms.png +0 -0
  204. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/polyfill-loader.gif +0 -0
  205. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/styles/shim.css +0 -1
  206. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/JarisFLVPlayer.swf +0 -0
  207. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/jwwebshims.swf +0 -0
  208. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/swf/localStorage.swf +0 -0
  209. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/track-ui.js +0 -1
  210. package/test/mocha/html-snapshots/server/vendor/js/libs/webshim/minified/shims/track.js +0 -1
  211. package/test/mocha/html-snapshots/server/vendor/js/plugins/cload.js +0 -49
  212. package/test/mocha/html-snapshots/server/vendor/js/plugins/modernizr.js +0 -4
  213. package/test/mocha/html-snapshots/server/vendor/js/plugins/oldie.js +0 -74
  214. package/test/mocha/html-snapshots/sitemap-index.js +0 -140
  215. package/test/mocha/html-snapshots/sitemap.js +0 -104
  216. package/test/mocha/html-snapshots/snapshot-scripts.js +0 -206
  217. package/test/mocha/html-snapshots/test.js +0 -105
  218. package/test/mocha/html-snapshots/test_robots.txt +0 -13
  219. package/test/mocha/html-snapshots/test_sitemap.xml +0 -22
  220. package/test/mocha/html-snapshots/use-jquery.js +0 -144
  221. package/test/mocha/html-snapshots/utils.js +0 -200
  222. package/test/mocha/input-generators/server/public/wordpress/category-sitemap.xml +0 -13
  223. package/test/mocha/input-generators/server/public/wordpress/page-sitemap.xml +0 -16
  224. package/test/mocha/input-generators/server/public/wordpress/post-sitemap.xml +0 -55
  225. package/test/mocha/input-generators/server/public/wordpress/post_tag-sitemap.xml +0 -25
  226. package/test/mocha/input-generators/server/public/wordpress/product-sitemap.xml +0 -13
  227. package/test/mocha/input-generators/server/test_robots.txt +0 -15
  228. package/test/mocha/input-generators/server/test_robots_bad.txt +0 -11
  229. package/test/mocha/input-generators/server/test_robots_sitemap.txt +0 -17
  230. package/test/mocha/input-generators/server/test_robots_sitemap_bad.txt +0 -17
  231. package/test/mocha/input-generators/server/test_robots_sitemap_multi.txt +0 -18
  232. package/test/mocha/input-generators/server/test_sitemap.xml +0 -34
  233. package/test/mocha/input-generators/server/test_sitemap.xml.gz +0 -0
  234. package/test/mocha/input-generators/server/test_sitemap_bad.xml.gz +0 -0
  235. package/test/mocha/input-generators/server/test_sitemap_index.xml +0 -25
  236. package/test/mocha/input-generators/server/test_sitemap_index.xml.gz +0 -0
  237. package/test/mocha/input-generators/server/test_sitemap_index_empty.xml +0 -3
  238. package/test/mocha/input-generators/server/test_sitemap_index_malformed.xml +0 -2
  239. package/test/mocha/input-generators/sitemap-index.js +0 -87
  240. package/test/mocha/input-generators/sitemap.js +0 -320
  241. package/test/mocha/input-generators/test.js +0 -1447
  242. package/test/mocha/input-generators/test_line.txt +0 -5
  243. package/test/mocha/input-generators/test_robots.txt +0 -15
  244. package/test/mocha/input-generators/test_robots_bad.txt +0 -11
  245. package/test/mocha/input-generators/test_robots_sitemap.txt +0 -17
  246. package/test/mocha/input-generators/test_robots_sitemap_bad.txt +0 -17
  247. package/test/mocha/input-generators/test_robots_sitemap_multi.txt +0 -18
  248. package/test/mocha/input-generators/test_sitemap.xml +0 -34
  249. package/test/mocha/input-generators/test_sitemap.xml.gz +0 -0
  250. package/test/mocha/input-generators/test_sitemap_bad.xml.gz +0 -0
  251. package/test/mocha/input-generators/test_sitemap_index.xml +0 -25
  252. package/test/mocha/input-generators/test_sitemap_index.xml.gz +0 -0
  253. package/test/server/index.js +0 -32
@@ -1,4 +0,0 @@
1
- /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
2
- * Build: http://modernizr.com/download/#-canvas-input-inputtypes-geolocation-inlinesvg-svg-svgclippaths-touch-shiv-mq-cssclasses-teststyles-testallprops-prefixes-css_boxsizing-forms_validation-ie8compat
3
- */
4
- ;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),Modernizr.addTest("boxsizing",function(){return Modernizr.testAllProps("boxSizing")&&(document.documentMode===undefined||document.documentMode>7)}),function(a,b){b.formvalidationapi=!1,b.formvalidationmessage=!1,b.addTest("formvalidation",function(){var c=a.createElement("form");if("checkValidity"in c){var d=a.body,e=a.documentElement,f=!1,g=!1,h;return b.formvalidationapi=!0,c.onsubmit=function(a){window.opera||a.preventDefault(),a.stopPropagation()},c.innerHTML='<input name="modTest" required><button></button>',c.style.position="absolute",c.style.top="-99999em",d||(f=!0,d=a.createElement("body"),d.style.background="",e.appendChild(d)),d.appendChild(c),h=c.getElementsByTagName("input")[0],h.oninvalid=function(a){g=!0,a.preventDefault(),a.stopPropagation()},b.formvalidationmessage=!!h.validationMessage,c.getElementsByTagName("button")[0].click(),d.removeChild(c),f&&e.removeChild(d),g}return!1})}(document,window.Modernizr),Modernizr.addTest("ie8compat",function(){return!window.addEventListener&&document.documentMode&&document.documentMode===7});
@@ -1,74 +0,0 @@
1
- /**
2
- * oldie.js
3
- *
4
- * Contains polyfills for old IE.
5
- * Depends on JQuery.
6
- *
7
- * box-sizing, border-box polyfill
8
- *
9
- **/
10
- define([], function() {
11
- $d = document;
12
-
13
- var orbit = function(height) {
14
- $("#featured-orbit").on("loadComplete", function() {
15
- $(".orbit-wrapper").css("height", height);
16
- $("#featured-orbit").css("height", height);
17
- });
18
- };
19
-
20
- var zIndex = function() {
21
- var zIndexNumber = 1000;
22
- // Put your target element(s) in the selector below!
23
- $("div").each(function() {
24
- $(this).css("zIndex", zIndexNumber);
25
- zIndexNumber -= 10;
26
- });
27
- };
28
-
29
- var borderBoxModel = function(elements, value) {
30
- var element, cs, s, i, max,
31
- fullW, actualW, newW;
32
-
33
- // cycle through all DOM elements
34
- for (i = 0, max = elements.length; i < max; i++) {
35
- element = elements[i];
36
- switch (element.nodeName) {
37
- case '#comment':
38
- case 'HTML':
39
- case 'HEAD':
40
- case 'TITLE':
41
- case 'SCRIPT':
42
- case 'NOSCRIPT':
43
- case 'STYLE':
44
- case 'LINK':
45
- case 'META':
46
- continue;
47
- default:
48
- break;
49
- }
50
-
51
- s = element.style;
52
- cs = element.currentStyle;
53
-
54
- // check if box-sizing is specified and is equal to border-box
55
- if(s.boxSizing == value || s["box-sizing"] == value ||
56
- cs.boxSizing == value || cs["box-sizing"] == value) {
57
- fullW = $(element).outerWidth(),
58
- actualW = $(element).width(),
59
- newW = actualW - (fullW - actualW);
60
- $(element).css("width", newW);
61
- }
62
- }
63
- };
64
-
65
- return {
66
- borderBoxModel: function() { borderBoxModel($d.getElementsByTagName('*'), 'border-box'); },
67
- zIndex: function() { zIndex(); },
68
- all: function() {
69
- borderBoxModel($d.getElementsByTagName('*'), 'border-box');
70
- zIndex();
71
- orbit("240px");
72
- }
73
- };
74
- });
@@ -1,140 +0,0 @@
1
- /**
2
- * Library tests that use sitemap-index.
3
- *
4
- * Copyright (c) 2013 - 2022, Alex Grant, LocalNerve, contributors
5
- */
6
- /* global it */
7
- const assert = require("assert");
8
- const path = require("path");
9
- const optHelp = require("../../helpers/options");
10
- const ss = require("../../../lib/html-snapshots");
11
- const utils = require("./utils");
12
-
13
- const {
14
- outputDir,
15
- timeout,
16
- unexpectedError,
17
- unexpectedSuccess,
18
- cleanup,
19
- checkActualFiles
20
- } = utils;
21
-
22
- // Sitemap-index constants
23
- const sitemapIndexFile = "test_sitemap_index.xml";
24
- const inputFile = path.join(__dirname, "./", sitemapIndexFile);
25
- const urls = 3; // must match the unqiue # of urls in all the sitemap files referenced in sitemap-index.
26
-
27
- function getClass (obj) {
28
- const string = Object.prototype.toString.call(obj);
29
- const m = /\[object ([^\]]+)/.exec(string);
30
- return m && m[1];
31
- }
32
-
33
- function sitemapIndexTests (options) {
34
- const {
35
- port,
36
- browsers
37
- } = options;
38
-
39
- function createOptions (newOptions) {
40
- const options = {
41
- source: `http://localhost:${port}/${sitemapIndexFile}`,
42
- input: "sitemap-index",
43
- selector: "#dynamic-content",
44
- outputDirClean: true,
45
- outputDir,
46
- timeout
47
- };
48
-
49
- return {
50
- ...options,
51
- ...newOptions
52
- };
53
- }
54
-
55
- return function () {
56
- browsers.forEach(browser => {
57
- it(`should succeed for typical sitemap-index usage - ${browser}`, function (done) {
58
- const options = createOptions({
59
- browser
60
- });
61
-
62
- ss.run(optHelp.decorate(options))
63
- .then(function (completed) {
64
- let assertionError;
65
- try {
66
- assert.equal(getClass(completed), "Array");
67
- assert.equal(completed.length, urls);
68
- } catch (e) {
69
- assertionError = e;
70
- }
71
- cleanup(done, assertionError);
72
- })
73
- .catch(err => {
74
- checkActualFiles(err.notCompleted)
75
- .then(() => {
76
- cleanup(done, err || unexpectedError);
77
- });
78
- });
79
- });
80
-
81
- it(`should fail fast for bad sitemap url - ${browser}`, function (done) {
82
- const sitemapIndexFile3 = path.basename(sitemapIndexFile, ".xml") + "-3" +
83
- path.extname(sitemapIndexFile);
84
- const options = createOptions({
85
- source: `http://localhost:${port}/${sitemapIndexFile3}`,
86
- browser
87
- });
88
-
89
- ss.run(optHelp.decorate(options))
90
- .then(unexpectedSuccess)
91
- .catch(err => {
92
- let assertionError;
93
- try {
94
- assert.equal(getClass(err.notCompleted), "Array");
95
- // fails fast:
96
- assert.equal(err.notCompleted.length, 0);
97
- } catch (e) {
98
- assertionError = e;
99
- }
100
- cleanup(done, assertionError);
101
- });
102
- });
103
-
104
- it(`should eventually fail for bad page url - ${browser}`, function (done) {
105
- const eventually = 1000;
106
- const sitemapIndexFile2 = path.basename(sitemapIndexFile, ".xml") + "-2" +
107
- path.extname(sitemapIndexFile);
108
- const options = createOptions({
109
- source: `http://localhost:${port}/${sitemapIndexFile2}`,
110
- timeout: {
111
- "http://localhost:8040/services/bad": eventually,
112
- __default: timeout
113
- },
114
- browser
115
- });
116
-
117
- ss.run(optHelp.decorate(options))
118
- .then(unexpectedSuccess)
119
- .catch(err => {
120
- let assertionError;
121
- try {
122
- assert.equal(getClass(err.completed), "Array");
123
- assert.equal(err.completed.length, urls - 1);
124
- assert.equal(getClass(err.notCompleted), "Array");
125
- assert.equal(err.notCompleted.length, 1);
126
- } catch (e) {
127
- assertionError = e;
128
- }
129
- cleanup(done, assertionError);
130
- });
131
- });
132
- });
133
- };
134
- }
135
-
136
- module.exports = {
137
- testSuite: sitemapIndexTests,
138
- urlCount: urls,
139
- inputFile
140
- };
@@ -1,104 +0,0 @@
1
- /**
2
- * Library tests that use sitemap.
3
- *
4
- * Copyright (c) 2013 - 2022, Alex Grant, LocalNerve, contributors
5
- */
6
- /* global it */
7
- const assert = require("assert");
8
- const path = require("path");
9
- const _ = require("lodash");
10
- const optHelp = require("../../helpers/options");
11
- const ss = require("../../../lib/html-snapshots");
12
- const utils = require("./utils");
13
-
14
- // missing destructuring, will write postcard...
15
- const {
16
- outputDir,
17
- cleanup,
18
- cleanupError,
19
- cleanupSuccess,
20
- unexpectedSuccess,
21
- testSuccess,
22
- checkActualFiles
23
- } = utils;
24
-
25
- // Sitemap constants
26
- const inputFile = path.join(__dirname, "./test_sitemap.xml");
27
- const urls = 3; // must match public/page_sitemap.xml
28
-
29
- function sitemapTests (options) {
30
- const {
31
- port,
32
- browsers
33
- } = options;
34
-
35
- return function () {
36
- function createOptions(newOptions) {
37
- const defaultOptions = {
38
- input: "sitemap",
39
- source: `http://localhost:${port}/index.html`,
40
- selector: "#dynamic-content",
41
- outputDirClean: true,
42
- timeout: 4000,
43
- outputDir,
44
- port
45
- };
46
- return {
47
- ...defaultOptions,
48
- ...newOptions
49
- };
50
- }
51
-
52
- browsers.forEach(browser => {
53
- it(`should all fail, bad remote sitemap - ${browser}`, function (done) {
54
- const options = createOptions({
55
- browser
56
- });
57
-
58
- const twice = _.after(2, cleanupError.bind(null, done, 0));
59
-
60
- ss.run(optHelp.decorate(options), twice)
61
- .then(unexpectedSuccess.bind(null, done))
62
- .catch(twice);
63
- });
64
-
65
- it("TODO: write more failure tests", function (done) {
66
- assert.ok(true, "TODO");
67
- done();
68
- });
69
-
70
- it(`should succeed simple case - ${browser}`, function (done) {
71
- const options = createOptions({
72
- source: `http://localhost:${port}/public/page-sitemap.xml`,
73
- browser
74
- });
75
-
76
- const twice = _.after(2, cleanupSuccess.bind(null, done));
77
- const success = (err, completed) => {
78
- assert.equal(completed.length, urls);
79
- testSuccess(twice, completed);
80
- };
81
-
82
- ss.run(optHelp.decorate(options), success)
83
- .then(success.bind(null, undefined))
84
- .catch(e => {
85
- checkActualFiles(e.notCompleted)
86
- .then(() => {
87
- cleanup(done, e);
88
- });
89
- });
90
- });
91
-
92
- it("TODO: write more success tests", function (done) {
93
- assert.ok(true, "TODO");
94
- done();
95
- });
96
- });
97
- };
98
- }
99
-
100
- module.exports = {
101
- testSuite: sitemapTests,
102
- inputFile: inputFile,
103
- urlCount: urls
104
- };
@@ -1,206 +0,0 @@
1
- /**
2
- * Library tests focused on the phantomjsOptions option.
3
- *
4
- * Copyright (c) 2013 - 2022, Alex Grant, LocalNerve, contributors
5
- */
6
- /* global beforeEach, describe, it */
7
-
8
- const path = require("path");
9
- const fs = require("fs");
10
- const _ = require("lodash");
11
- const rimraf = require("rimraf").sync;
12
- const utils = require("./utils");
13
- const optHelp = require("../../helpers/options");
14
- const ss = require("../../../lib/html-snapshots");
15
-
16
- const {
17
- timeout,
18
- outputDir,
19
- cleanup,
20
- bogusFile,
21
- cleanupError,
22
- unexpectedSuccess,
23
- checkActualFiles
24
- } = utils;
25
-
26
- function snapshotScriptTests (options) {
27
- const {
28
- localRobotsFile: inputFile,
29
- port,
30
- browsers
31
- } = options;
32
-
33
- return function () {
34
- const removeScriptsConfig = {
35
- name: "removeScripts",
36
- option: {
37
- script: "removeScripts"
38
- },
39
- browser: "phantomjs",
40
- prove: (completed, done) => {
41
- // console.log("@@@ removeScripts prove @@@");
42
- let content, err;
43
- for (var i = 0; i < completed.length; i++) {
44
- content = fs.readFileSync(completed[i], { encoding: "utf8" });
45
- if (/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi.test(content)) {
46
- err = new Error("removeScripts failed. Script tag found in "+completed[i]);
47
- break;
48
- }
49
- }
50
- done(err);
51
- }
52
- };
53
- const customFilterConfig = {
54
- name: "customFilter",
55
- option: {
56
- script: "customFilter",
57
- module: path.join(__dirname, "myFilter.js")
58
- },
59
- browser: "phantomjs",
60
- prove: (completed, done) => {
61
- // console.log("@@@ customFilter prove @@@");
62
- let content, err;
63
- for (let i = 0; i < completed.length; i++) {
64
- // console.log("@@@ readFile "+completed[i]);
65
- content = fs.readFileSync(completed[i], { encoding: "utf8" });
66
- // this is dependent on myFilter.js adding someattrZZQy anywhere
67
- if (content.indexOf("someattrZZQy") < 0) {
68
- err = new Error("customFilter snapshotScript failed. Special sequence not found in "+completed[i]);
69
- break;
70
- }
71
- }
72
- done(err);
73
- }
74
- };
75
- const snapshotScriptTests = [];
76
- browsers.forEach(browser => {
77
- snapshotScriptTests.push({
78
- ...removeScriptsConfig,
79
- ...{
80
- name: `${removeScriptsConfig.name}-${browser}`,
81
- browser
82
- }
83
- });
84
- snapshotScriptTests.push({
85
- ...customFilterConfig,
86
- ...{
87
- name: `${customFilterConfig.name}-${browser}`,
88
- browser
89
- }
90
- });
91
- });
92
-
93
- describe("should succeed for scripts", function () {
94
- let testNumber = 0, snapshotScriptTest;
95
- const scriptNames = snapshotScriptTests.map(test => test.name);
96
-
97
- beforeEach(function () {
98
- snapshotScriptTest = snapshotScriptTests[testNumber++];
99
- });
100
-
101
- function snapshotScriptTestDefinition (done) {
102
- const options = {
103
- source: inputFile,
104
- hostname: "localhost",
105
- selector: "#dynamic-content",
106
- outputDirClean: true,
107
- timeout: timeout,
108
- snapshotScript: snapshotScriptTest.option,
109
- browser: snapshotScriptTest.browser,
110
- outputDir,
111
- port
112
- };
113
-
114
- rimraf(outputDir);
115
-
116
- ss.run(optHelp.decorate(options))
117
- .then(completed => {
118
- snapshotScriptTest.prove(completed, e => {
119
- cleanup(done, e);
120
- });
121
- })
122
- .catch(err => {
123
- checkActualFiles(err.notCompleted)
124
- .then(() => {
125
- cleanup(done, err);
126
- });
127
- });
128
- }
129
-
130
- scriptNames.forEach((scriptName, i) => {
131
- it(`snapshot script ${scriptName}, ${snapshotScriptTests[i].browser}`, function (done) {
132
- setTimeout(snapshotScriptTestDefinition, 3000, done);
133
- });
134
- });
135
- });
136
-
137
- describe("should fail for scripts", function () {
138
- function createOptions (newOptions) {
139
- const defaultOptions = {
140
- source: inputFile,
141
- hostname: "localhost",
142
- selector: "#dynamic-content",
143
- outputDirClean: true,
144
- snapshotScript: bogusFile,
145
- timeout: 2000,
146
- outputDir,
147
- port
148
- };
149
- return {
150
- ...defaultOptions,
151
- ...newOptions
152
- };
153
- }
154
-
155
- const testOptions = [{
156
- name: "should fail if a bogus script string is supplied",
157
- options: {
158
- snapshotScript: bogusFile
159
- }
160
- }, {
161
- name: "should fail if a bogus script object is supplied",
162
- options: {
163
- snapshotScript: {
164
- script: bogusFile
165
- }
166
- }
167
- }, {
168
- name: "should fail if a customFilter is defined but no module",
169
- options: {
170
- snapshotScript: {
171
- script: "customFilter"
172
- }
173
- }
174
- }, {
175
- name: "should fail if a customFilter is defined and bogus module",
176
- options: {
177
- browser: "phantomjs",
178
- snapshotScript: {
179
- script: "customFilter",
180
- module: bogusFile
181
- }
182
- }
183
- }];
184
- const driverOptions = browsers.map(browser => {
185
- return testOptions.map(test => {
186
- test.options.browser = browser;
187
- return JSON.parse(JSON.stringify(test));
188
- });
189
- }).flat();
190
-
191
- driverOptions.forEach(driver => {
192
- it(driver.name, function (done) {
193
- const options = createOptions(driver.options);
194
- const twice = _.after(2, cleanupError.bind(null, done, 0));
195
- ss.run(optHelp.decorate(options), twice)
196
- .then(unexpectedSuccess.bind(null, done))
197
- .catch(twice);
198
- });
199
- });
200
- });
201
- };
202
- }
203
-
204
- module.exports = {
205
- testSuite: snapshotScriptTests
206
- };
@@ -1,105 +0,0 @@
1
- /**
2
- * Driver for html-snapshots library tests.
3
- *
4
- * Copyright (c) 2013 - 2022, Alex Grant, LocalNerve, contributors
5
- */
6
- /* global describe, before, after */
7
- const path = require("path");
8
- const enableDestroy = require("server-destroy");
9
-
10
- const { timeout } = require("./utils");
11
-
12
- const basics = require("./basics");
13
- const robots = require("./robots");
14
- const sitemap = require("./sitemap");
15
- const sitemapIndex = require("./sitemap-index");
16
- const processLimit = require("./process-limit");
17
- const useJQuery = require("./use-jquery");
18
- const snapshotScripts = require("./snapshot-scripts");
19
- const phantomJSOptions = require("./phantomjs-options");
20
- const puppeteer = require("./puppeteer");
21
-
22
- const localRobotsFile = path.join(__dirname, "./test_robots.txt");
23
-
24
- /**
25
- * Create a test context with a new server on a port.
26
- * Why? Managing the resources (sockets) closely makes a real difference
27
- * on test services like Travis.
28
- *
29
- * @param {Function} testSuiteFactory - The test suite.
30
- * @param {Number} port - The server port.
31
- * @returns {Function} A test context with server management.
32
- */
33
- function serverContext (testSuiteFactory, port) {
34
- const server = require("../../server");
35
-
36
- return function () {
37
- let httpServer;
38
-
39
- before(function (done) {
40
- server.start(path.join(__dirname, "./server"), port,
41
- function (err, srv) {
42
- if (err) {
43
- return done(err);
44
- }
45
-
46
- httpServer = srv;
47
- enableDestroy(httpServer);
48
- done();
49
- });
50
- });
51
-
52
- after(function (done) {
53
- httpServer.destroy(function () {
54
- setTimeout(done, 2000);
55
- });
56
- });
57
-
58
- describe("tests", testSuiteFactory({
59
- port,
60
- localRobotsFile,
61
- browsers: ["phantomjs", "puppeteer"]
62
- }));
63
- };
64
- }
65
-
66
- describe("html-snapshots", function () {
67
-
68
- this.timeout(timeout * robots.urlCount - 1);
69
-
70
- describe("run basics", serverContext(basics.testSuite, 8034));
71
-
72
- describe(
73
- "phantomjsOptions option", serverContext(phantomJSOptions.testSuite, 8035)
74
- );
75
-
76
- describe(
77
- "puppeteer specific tests", serverContext(puppeteer.testSuite, 8042)
78
- );
79
-
80
- describe(
81
- "additional snapshot scripts", serverContext(snapshotScripts.testSuite, 8036)
82
- );
83
-
84
- describe(
85
- "useJQuery option", serverContext(useJQuery.testSuite, 8037)
86
- );
87
-
88
- describe(
89
- "robots", serverContext(robots.testSuite, 8038)
90
- );
91
-
92
- describe(
93
- // If you change the port, change the test fixtures, too.
94
- "sitemap", serverContext(sitemap.testSuite, 8039)
95
- );
96
-
97
- describe(
98
- // If you change the port, change the test fixutres, too.
99
- "sitemap-index", serverContext(sitemapIndex.testSuite, 8040)
100
- );
101
-
102
- describe(
103
- "processLimit option", serverContext(processLimit.testSuite, 8041)
104
- );
105
- });
@@ -1,13 +0,0 @@
1
- User-agent: *
2
-
3
- Allow: /
4
- Allow: /contact
5
- Allow: /services/carpets
6
-
7
- Disallow: /api/
8
- Disallow: /vendor/
9
- Disallow: /fonts/
10
- Disallow: /images/
11
-
12
- User-agent: ia_archiver
13
- Disallow: /
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
4
- <url>
5
- <loc>http://localhost:8039/</loc>
6
- <lastmod>2012-08-11T12:16:09+00:00</lastmod>
7
- <changefreq>daily</changefreq>
8
- <priority>1.0</priority>
9
- </url>
10
- <url>
11
- <loc>http://localhost:8039/contact</loc>
12
- <lastmod>2012-11-02T02:53:40+00:00</lastmod>
13
- <changefreq>weekly</changefreq>
14
- <priority>0.6</priority>
15
- </url>
16
- <url>
17
- <loc>http://localhost:8039/services/carpets</loc>
18
- <lastmod>2012-10-19T10:45:23+00:00</lastmod>
19
- <changefreq>weekly</changefreq>
20
- <priority>0.6</priority>
21
- </url>
22
- </urlset>