test: allow filtering async internal frames in assertSnapshot

PR-URL: https://github.com/nodejs/node/pull/61769
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
This commit is contained in:
Joyee Cheung authored and Antoine du Hamel committed 2026-04-08 23:53:06 +02:00
1 parent ec2913f036
commit a20bf9a84d
1 file changed
+1 -1
+1 -1
View File
@@ -18,7 +18,7 @@ const { hostname } = require('node:os');
* Group 6: Line end (including color codes and `{` which indicates the start of an error object details)
*/
// Mappings: (g1 ) (g2 ) (g3 ) (g4 ) (g5 ) (g6 )
const internalStackFramesRegexp = /(?<=\n)(\s*(?:\x1b?\[\d+m\s+)?(?:at\s)?)(?:(.+?)\s+\()?(?:(node:.+?):(\d+)(?::(\d+))?)\)?((?:\x1b?\[\d+m)?\s*{?\n|$)/g;
const internalStackFramesRegexp = /(?<=\n)(\s*(?:\x1b?\[\d+m\s+)?(?:at\s+)?)(?:async\s+)?(?:(.+?)\s+\()?(?:(node:.+?):(\d+)(?::(\d+))?)\)?((?:\x1b?\[\d+m)?\s*{?\n|$)/g;
/**
* Group 1: Filename
* Group 2: Line number