test-dependencies.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>reveal.js - Test Dependencies</title>
  6. </head>
  7. <body style="overflow: auto;">
  8. <div id="qunit"></div>
  9. <div id="qunit-fixture"></div>
  10. <div class="reveal" style="display: none;">
  11. <div class="slides">
  12. <section>Slide content</section>
  13. </div>
  14. </div>
  15. <script type="module">
  16. import 'reveal.css';
  17. import 'qunit/qunit/qunit.css';
  18. import QUnit from 'qunit';
  19. import Reveal from 'reveal.js';
  20. window.externalScriptSequence = '';
  21. QUnit.config.testTimeout = 30000;
  22. QUnit.config.autostart = false;
  23. QUnit.module( 'Dependencies' );
  24. Reveal.initialize({
  25. dependencies: [
  26. { src: 'assets/external-script-a.js' },
  27. { src: 'assets/external-script-b.js' },
  28. { src: 'assets/external-script-c.js' }
  29. ]
  30. }).then( () => {
  31. QUnit.start();
  32. QUnit.test( 'Load synchronous scripts', function( assert ) {
  33. assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' );
  34. });
  35. } );
  36. </script>
  37. </body>
  38. </html>