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');
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 ) ;
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import initGlobalAPI from '../../src/core/global-api.js';
2
2
3
3
// Suite
4
4
// -----------------------------------------------------------------------------
5
- describe ( 'Global APIs ' , function ( ) {
5
+ describe ( 'initGlobalAPI ' , function ( ) {
6
6
// Tests
7
7
// ---------------------------------------------------------------------------
8
- test ( 'APIs are available' , ( ) => {
8
+ test ( 'it makes Docsify APIs available globally ' , ( ) => {
9
9
initGlobalAPI ( ) ;
10
10
11
11
expect ( typeof window . Docsify ) . toEqual ( 'object' ) ;
You can’t perform that action at this time.
0 commit comments