Skip to content

Commit b0d7c51

Browse files
committed
no deprecated method
1 parent 751eec5 commit b0d7c51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/jest-core/src/collectHandles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ export function formatHandleErrors(
182182
return;
183183
}
184184

185-
const stackText = ansiFree.substr(ansiFree.indexOf(match[1])).trim();
185+
const stackText = ansiFree.slice(ansiFree.indexOf(match[1])).trim();
186186

187187
const name = ansiFree.match(/(?<= {2}).*$/m);
188-
if (!name?.length) {
188+
if (name == null || name.length === 0) {
189189
return;
190190
}
191191

0 commit comments

Comments
 (0)