Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | |
| 4 | <head> |
| 5 | <meta charset="utf-8"> |
| 6 | |
| 7 | <title>reveal.js - Test Dependencies</title> |
| 8 | |
| 9 | <link rel="stylesheet" href="../dist/reveal.css"> |
| 10 | <link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css"> |
| 11 | <script src="../node_modules/qunit/qunit/qunit.js"></script> |
| 12 | </head> |
| 13 | |
| 14 | <body style="overflow: auto;"> |
| 15 | |
| 16 | <div id="qunit"></div> |
| 17 | <div id="qunit-fixture"></div> |
| 18 | |
| 19 | <div class="reveal" style="display: none;"> |
| 20 | |
| 21 | <div class="slides"> |
| 22 | |
| 23 | <section>Slide content</section> |
| 24 | |
| 25 | </div> |
| 26 | |
| 27 | </div> |
| 28 | |
| 29 | <script src="../dist/reveal.js"></script> |
| 30 | <script> |
| 31 | window.externalScriptSequence = ''; |
| 32 | |
Marc Kupietz | 09b7575 | 2023-10-07 09:32:19 +0200 | [diff] [blame^] | 33 | QUnit.config.testTimeout = 30000; |
| 34 | QUnit.config.autostart = false; |
| 35 | QUnit.module( 'Dependencies' ); |
| 36 | |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 37 | Reveal.initialize({ |
| 38 | dependencies: [ |
| 39 | { src: 'assets/external-script-a.js' }, |
| 40 | { src: 'assets/external-script-b.js' }, |
| 41 | { src: 'assets/external-script-c.js' } |
| 42 | ] |
| 43 | }).then( () => { |
| 44 | |
Marc Kupietz | 09b7575 | 2023-10-07 09:32:19 +0200 | [diff] [blame^] | 45 | QUnit.start(); |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 46 | |
| 47 | QUnit.test( 'Load synchronous scripts', function( assert ) { |
| 48 | assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' ); |
| 49 | }); |
| 50 | |
| 51 | } ); |
| 52 | </script> |
| 53 | |
| 54 | </body> |
| 55 | </html> |