amd.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>Mocha Tests</title>
  5. <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
  6. </head>
  7. <body>
  8. <script src="../node_modules/mocha/mocha.js"></script>
  9. <div id="mocha"></div>
  10. <script src="../node_modules/curl-amd/src/curl.js"></script>
  11. <script src="test.js"></script>
  12. <script>
  13. curl.config({
  14. //By default load any module IDs from js/lib
  15. waitSeconds:15,
  16. use: {
  17. mocha: {
  18. attach: 'mocha'
  19. },
  20. mochaPhantomJS: {
  21. attach: 'mochaPhantomJS'
  22. },
  23. testPoints: {
  24. attach: 'testPoints'
  25. },
  26. aWKT: {
  27. attach: 'aWKT'
  28. }
  29. },packages: [
  30. {
  31. name: 'proj4',
  32. location: '../dist',
  33. main: 'proj4-src.js',
  34. config: { moduleLoader: '../node_modules/curl-amd/src/curl/loader/cjsm11' } /* <-- hey! */
  35. },
  36. {
  37. name:'mgrs',
  38. location:'../node_modules/mgrs',
  39. main:'mgrs.js',
  40. config: { moduleLoader: '../node_modules/curl-amd/src/curl/loader/cjsm11' } /* <-- hey! */
  41. }
  42. ]
  43. });
  44. mocha.setup({
  45. ui: "bdd",
  46. globals: ["console"],
  47. timeout: 300000,
  48. ignoreLeaks: true
  49. });
  50. curl(['../node_modules/chai/chai.js', 'proj4','testData']).then(startTests).then(function(){
  51. if (window.mochaPhantomJS) {
  52. window.mochaPhantomJS.run();
  53. } else {
  54. window.mocha.run();
  55. }
  56. });
  57. </script>
  58. </body>
  59. </html>