@@ -669,6 +669,62 @@ describe("Utility Functions (logic-only)", () => {
669669 it ( "returns undefined for non-string input" , ( ) => {
670670 expect ( resolveObject ( 123 ) ) . toBeUndefined ( ) ;
671671 } ) ;
672+ it ( "returns undefined for empty string" , ( ) => {
673+ expect ( resolveObject ( "" ) ) . toBeUndefined ( ) ;
674+ } ) ;
675+ it ( "returns undefined for boolean input" , ( ) => {
676+ expect ( resolveObject ( true ) ) . toBeUndefined ( ) ;
677+ } ) ;
678+ it ( "returns undefined for object input" , ( ) => {
679+ expect ( resolveObject ( { } ) ) . toBeUndefined ( ) ;
680+ } ) ;
681+ it ( "returns undefined when null encountered in path" , ( ) => {
682+ global . TestNull = { A : null } ;
683+ expect ( resolveObject ( "TestNull.A.B" ) ) . toBeUndefined ( ) ;
684+ delete global . TestNull ;
685+ } ) ;
686+ it ( "returns undefined and warns if an error occurs during resolution" , ( ) => {
687+ const warnSpy = jest . spyOn ( console , "warn" ) . mockImplementation ( ( ) => { } ) ;
688+
689+ const originalSplit = String . prototype . split ;
690+ String . prototype . split = ( ) => {
691+ throw new Error ( "forced error" ) ;
692+ } ;
693+ expect ( resolveObject ( "Any.Path" ) ) . toBeUndefined ( ) ;
694+ expect ( warnSpy ) . toHaveBeenCalled ( ) ;
695+ String . prototype . split = originalSplit ;
696+ warnSpy . mockRestore ( ) ;
697+ } ) ;
698+ } ) ;
699+ describe ( "delayExecution()" , ( ) => {
700+ beforeEach ( ( ) => {
701+ jest . useFakeTimers ( ) ;
702+ } ) ;
703+ afterEach ( ( ) => {
704+ jest . useRealTimers ( ) ;
705+ } ) ;
706+ it ( "resolves after the specified duration" , async ( ) => {
707+ const promise = delayExecution ( 1000 ) ;
708+ jest . advanceTimersByTime ( 1000 ) ;
709+ await expect ( promise ) . resolves . toBe ( true ) ;
710+ } ) ;
711+ it ( "does not resolve before duration" , async ( ) => {
712+ const promise = delayExecution ( 1000 ) ;
713+
714+ let resolved = false ;
715+ promise . then ( ( ) => {
716+ resolved = true ;
717+ } ) ;
718+ jest . advanceTimersByTime ( 500 ) ;
719+ await Promise . resolve ( ) ;
720+ expect ( resolved ) . toBe ( false ) ;
721+ jest . advanceTimersByTime ( 500 ) ;
722+ } ) ;
723+ it ( "resolves immediately when duration is 0" , async ( ) => {
724+ const promise = delayExecution ( 0 ) ;
725+ jest . advanceTimersByTime ( 0 ) ;
726+ await expect ( promise ) . resolves . toBe ( true ) ;
727+ } ) ;
672728 } ) ;
673729 describe ( "importMembers()" , ( ) => {
674730 class DummyModel {
0 commit comments