File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 33 * @module tests/reporters/Notifier
44 */
55
6- import { isArray , type OneOrMany } from '#src'
6+ import { cast , isArray , type OneOrMany } from '#src'
77import notifier from 'node-notifier'
88import type NotificationCenter from 'node-notifier/notifiers/notificationcenter'
99import { performance } from 'node:perf_hooks'
@@ -162,7 +162,7 @@ class Notifier implements Reporter {
162162 }
163163
164164 /**
165- * Returns an array of {@link Test} objects.
165+ * Returns an array of {@linkcode Test} objects.
166166 *
167167 * @protected
168168 *
@@ -172,7 +172,7 @@ class Notifier implements Reporter {
172172 protected tests ( tasks : OneOrMany < Task > = [ ] ) : Test [ ] {
173173 return ( isArray < Task > ( tasks ) ? tasks : [ tasks ] ) . flatMap ( task => {
174174 return task . type === 'custom'
175- ? [ task as unknown as Test ]
175+ ? [ cast ( task ) ]
176176 : task . type === 'test'
177177 ? [ task ]
178178 : 'tasks' in task
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import type { Class, Optional } from '#src/types'
77import cast from './cast'
88import define from './define'
99import descriptor from './descriptor'
10+ import ifelse from './ifelse'
1011import isArray from './is-array'
1112import isArrayBuffer from './is-array-buffer'
1213import isBuffer from './is-buffer'
@@ -97,9 +98,9 @@ const clone = <T>(value: T): T => {
9798 }
9899
99100 // clone unknown value
100- if ( ! cast < Optional < T > > ( result ) ) result = new Clone ( )
101+ if ( ! cast < Optional < T > > ( result ) && isFunction ( Clone ) ) result = new Clone ( )
101102
102- return result
103+ return ifelse ( result , result , cast ( { } ) )
103104 }
104105
105106 /**
You can’t perform that action at this time.
0 commit comments