返回 reveal.js
test-dependencies.html
根目录 / test / test-dependencies.html
1 <!doctype html>
2 <html lang="en">
3
4 <head>
5 <meta charset="utf-8">
6
7 <title>reveal.js - Test Dependencies</title>
8 </head>
9
10 <body style="overflow: auto;">
11
12 <div id="qunit"></div>
13 <div id="qunit-fixture"></div>
14
15 <div class="reveal" style="display: none;">
16
17 <div class="slides">
18
19 <section>Slide content</section>
20
21 </div>
22
23 </div>
24
25 <script type="module">
26 import 'reveal.css';
27 import 'qunit/qunit/qunit.css';
28 import QUnit from 'qunit';
29 import Reveal from 'reveal.js';
30
31 window.externalScriptSequence = '';
32
33 QUnit.config.testTimeout = 30000;
34 QUnit.config.autostart = false;
35 QUnit.module( 'Dependencies' );
36
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
45 QUnit.start();
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>
56
56 lines HTML