@@ -24,10 +24,27 @@ function replaceSpecDuration(str) {
24
24
. replaceAll ( / d u r a t i o n _ m s [ 0 - 9 . ] + / g, 'duration_ms *' )
25
25
. replace ( stackTraceBasePath , '$3' ) ;
26
26
}
27
- const defaultTransform = snapshot
28
- . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceStackTrace , replaceTestDuration ) ;
29
- const specTransform = snapshot
30
- . transform ( replaceSpecDuration , snapshot . replaceWindowsLineEndings , snapshot . replaceStackTrace ) ;
27
+
28
+ function removeWindowsPathEscaping ( str ) {
29
+ return common . isWindows ? str . replaceAll ( / \\ \\ / g, '\\' ) : str ;
30
+ }
31
+
32
+ const defaultTransform = snapshot . transform (
33
+ snapshot . replaceWindowsLineEndings ,
34
+ snapshot . replaceStackTrace ,
35
+ replaceTestDuration ,
36
+ ) ;
37
+ const specTransform = snapshot . transform (
38
+ replaceSpecDuration ,
39
+ snapshot . replaceWindowsLineEndings ,
40
+ snapshot . replaceStackTrace ,
41
+ ) ;
42
+ const withFileNameTransform = snapshot . transform (
43
+ defaultTransform ,
44
+ removeWindowsPathEscaping ,
45
+ snapshot . replaceFullPaths ,
46
+ snapshot . replaceWindowsPaths ,
47
+ ) ;
31
48
32
49
33
50
const tests = [
@@ -41,6 +58,7 @@ const tests = [
41
58
{ name : 'test-runner/output/hooks-with-no-global-test.js' } ,
42
59
{ name : 'test-runner/output/before-and-after-each-too-many-listeners.js' } ,
43
60
{ name : 'test-runner/output/before-and-after-each-with-timeout-too-many-listeners.js' } ,
61
+ { name : 'test-runner/output/global_after_should_fail_the_test.js' , transform : withFileNameTransform } ,
44
62
{ name : 'test-runner/output/no_refs.js' } ,
45
63
{ name : 'test-runner/output/no_tests.js' } ,
46
64
{ name : 'test-runner/output/only_tests.js' } ,
0 commit comments