33"use strict" ;
44
55require ( "should" ) ;
6+ import { HandlerNotFound } from "../../../src/Errors" ;
67import { load } from "../../../src/utils/UserFunction" ;
78
89describe ( "Invoking the load function" , async ( ) => {
9- it ( "should not fail when init hook function is present" , async ( ) => {
10+ it ( "should resolve promise when init hook function is present" , async ( ) => {
1011 const handler = "InitPresent.handler"
1112 const appRoot = "test/unit/utils/function" ;
1213
@@ -16,9 +17,9 @@ describe("Invoking the load function", async() => {
1617 ) ) as Function ;
1718
1819 handlerFunc . should . be . Function ;
19- handlerFunc . should . not . be . null ;
20+ handlerFunc ( ) . should . be . true ;
2021 } ) ;
21- it ( "should not fail when init hook function is absent" , async ( ) => {
22+ it ( "should not resolve the promise when init hook function is absent" , async ( ) => {
2223 const handler = "InitAbsent.handler"
2324 const appRoot = "test/unit/utils/function" ;
2425
@@ -28,7 +29,7 @@ describe("Invoking the load function", async() => {
2829 ) ) as Function ;
2930
3031 handlerFunc . should . be . Function ;
31- handlerFunc . should . not . be . null ;
32+ handlerFunc ( ) . should . be . false ;
3233 } ) ;
3334 it ( "should catch TypeError exception" , async ( ) => {
3435 const handler = "InitThrowsTypeError.handler"
@@ -40,6 +41,6 @@ describe("Invoking the load function", async() => {
4041 ) ) as Function ;
4142
4243 handlerFunc . should . be . Function ;
43- handlerFunc . should . not . be . null ;
44+ handlerFunc ( ) . should . be . true ;
4445 } ) ;
4546} ) ;
0 commit comments