index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Punycode.js test suite</title>
  6. <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
  7. </head>
  8. <body>
  9. <div id="qunit"></div>
  10. <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
  11. <script src="../punycode.js"></script>
  12. <script>
  13. QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
  14. document.write(QUnit.urlParams.norequire
  15. ? '<script src="tests.js"><\/script>'
  16. : '<script src="../node_modules/requirejs/require.js"><\/script>'
  17. );
  18. </script>
  19. <script>
  20. (function(root) {
  21. if (!root.require) {
  22. return;
  23. }
  24. QUnit.config.autostart = false;
  25. requirejs.config({
  26. 'baseUrl': './',
  27. 'urlArgs': 't=' + (+new Date),
  28. 'waitSeconds': 0,
  29. 'packages': [
  30. {
  31. 'name': 'punycode',
  32. 'location': '..',
  33. 'main': 'punycode'
  34. },
  35. {
  36. 'name': 'tests',
  37. 'location': '.',
  38. 'main': 'tests'
  39. }
  40. ]
  41. });
  42. require(['punycode'], function(punycode) {
  43. root.punycode = punycode;
  44. require(['tests'], function() {
  45. QUnit.start();
  46. });
  47. });
  48. }(this));
  49. </script>
  50. </body>
  51. </html>