File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,22 @@ const docsifyInit = require('../helpers/docsify-init');
55describe ( 'Docsify' , function ( ) {
66 // Tests
77 // ---------------------------------------------------------------------------
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+
824 test ( 'allows $docsify configuration to be a function' , async ( ) => {
925 const testConfig = jest . fn ( vm => {
1026 expect ( vm ) . toBeInstanceOf ( Object ) ;
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import initGlobalAPI from '../../src/core/global-api.js';
22
33// Suite
44// -----------------------------------------------------------------------------
5- describe ( 'Global APIs ' , function ( ) {
5+ describe ( 'initGlobalAPI ' , function ( ) {
66 // Tests
77 // ---------------------------------------------------------------------------
8- test ( 'APIs are available' , ( ) => {
8+ test ( 'it makes Docsify APIs available globally ' , ( ) => {
99 initGlobalAPI ( ) ;
1010
1111 expect ( typeof window . Docsify ) . toEqual ( 'object' ) ;
You can’t perform that action at this time.
0 commit comments