@@ -5,9 +5,6 @@ describe('renderHTML', () => {
55 const originalRequireResolve = require . resolve ;
66 const mockThemePath = 'mock/path/to/jsonresume-theme-even' ;
77 require . resolve = ( ...args ) => {
8- if ( args [ 0 ] === 'jsonresume-theme-even' ) {
9- return mockThemePath ;
10- }
118 if ( args [ 0 ] === 'jsonresume-theme-even' ) {
129 return mockThemePath ;
1310 }
@@ -25,13 +22,13 @@ describe('renderHTML', () => {
2522 } ,
2623 } ;
2724
28- it ( 'should reject when theme is not availlable ' , async ( ) => {
25+ it ( 'should reject when theme is not available ' , async ( ) => {
2926 await expect (
3027 renderHTML ( { resume, themePath : 'unknown' } ) ,
3128 ) . rejects . toBeTruthy ( ) ;
3229 } ) ;
3330
34- describe ( 'should render html when theme is availlable ' , ( ) => {
31+ describe ( 'should render html when theme is available ' , ( ) => {
3532 it ( 'with long theme name' , async ( ) => {
3633 expect (
3734 await renderHTML ( { resume, themePath : 'jsonresume-theme-even' } ) ,
@@ -43,5 +40,20 @@ describe('renderHTML', () => {
4340 '<!doctype html>' ,
4441 ) ;
4542 } ) ;
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+ } ) ;
4658 } ) ;
4759} ) ;
0 commit comments