@@ -5,6 +5,9 @@ describe('renderHTML', () => {
5
5
const originalRequireResolve = require . resolve ;
6
6
const mockThemePath = 'mock/path/to/jsonresume-theme-even' ;
7
7
require . resolve = ( ...args ) => {
8
+ if ( args [ 0 ] === 'jsonresume-theme-even' ) {
9
+ return mockThemePath ;
10
+ }
8
11
if ( args [ 0 ] === 'jsonresume-theme-even' ) {
9
12
return mockThemePath ;
10
13
}
@@ -22,13 +25,13 @@ describe('renderHTML', () => {
22
25
} ,
23
26
} ;
24
27
25
- it ( 'should reject when theme is not available ' , async ( ) => {
28
+ it ( 'should reject when theme is not availlable ' , async ( ) => {
26
29
await expect (
27
30
renderHTML ( { resume, themePath : 'unknown' } ) ,
28
31
) . rejects . toBeTruthy ( ) ;
29
32
} ) ;
30
33
31
- describe ( 'should render html when theme is available ' , ( ) => {
34
+ describe ( 'should render html when theme is availlable ' , ( ) => {
32
35
it ( 'with long theme name' , async ( ) => {
33
36
expect (
34
37
await renderHTML ( { resume, themePath : 'jsonresume-theme-even' } ) ,
@@ -40,20 +43,5 @@ describe('renderHTML', () => {
40
43
'<!doctype html>' ,
41
44
) ;
42
45
} ) ;
43
-
44
- it ( 'should reject theme with invalid path' , async ( ) => {
45
- await expect (
46
- renderHTML ( { resume, themePath : './unknown' } ) ,
47
- ) . rejects . toBeTruthy ( ) ;
48
- } ) ;
49
-
50
- it ( 'with local theme path' , async ( ) => {
51
- expect (
52
- await renderHTML ( {
53
- resume,
54
- themePath : './node_modules/jsonresume-theme-even' ,
55
- } ) ,
56
- ) . toStartWith ( '<!doctype html>' ) ;
57
- } ) ;
58
46
} ) ;
59
47
} ) ;
0 commit comments