@@ -5,6 +5,22 @@ const docsifyInit = require('../helpers/docsify-init');
5
5
describe ( 'Docsify' , function ( ) {
6
6
// Tests
7
7
// ---------------------------------------------------------------------------
8
+ it ( 'global APIs are available' , async ( ) => {
9
+ await docsifyInit ( ) ;
10
+
11
+ // If the script was built successfully for production, then it should load
12
+ // and the following APIs should be available:
13
+ expect ( typeof window . Docsify ) . toEqual ( 'object' ) ;
14
+ expect ( typeof window . Docsify . util ) . toEqual ( 'object' ) ;
15
+ expect ( typeof window . Docsify . dom ) . toEqual ( 'object' ) ;
16
+ expect ( typeof window . Docsify . get ) . toEqual ( 'function' ) ;
17
+ expect ( typeof window . Docsify . slugify ) . toEqual ( 'function' ) ;
18
+ expect ( typeof window . Docsify . version ) . toEqual ( 'string' ) ;
19
+ expect ( typeof window . DocsifyCompiler ) . toEqual ( 'function' ) ;
20
+ expect ( typeof window . marked ) . toEqual ( 'function' ) ;
21
+ expect ( typeof window . Prism ) . toEqual ( 'object' ) ;
22
+ } ) ;
23
+
8
24
test ( 'allows $docsify configuration to be a function' , async ( ) => {
9
25
const testConfig = jest . fn ( vm => {
10
26
expect ( vm ) . toBeInstanceOf ( Object ) ;
0 commit comments