File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 41
41
"@babel/runtime" : " ^7.10.3" ,
42
42
"@types/aria-query" : " ^4.2.0" ,
43
43
"aria-query" : " ^4.2.2" ,
44
+ "chalk" : " ^4.1.0" ,
44
45
"dom-accessibility-api" : " ^0.4.6" ,
45
46
"pretty-format" : " ^25.5.0"
46
47
},
Original file line number Diff line number Diff line change 1
1
import { getUserTrace } from '../get-user-trace'
2
2
3
+ jest . mock ( 'chalk' , ( ) => ( {
4
+ gray : msg => msg ,
5
+ } ) )
6
+
3
7
let globalErrorMock
4
8
5
9
beforeEach ( ( ) => {
Original file line number Diff line number Diff line change
1
+ import chalk from 'chalk'
2
+
1
3
// Frame has the form "at myMethod (location/to/my/file.js:10:2)"
2
4
function getFrameLocation ( frame ) {
3
5
const locationStart = frame . indexOf ( '(' ) + 1
@@ -13,7 +15,7 @@ function getUserTrace() {
13
15
. slice ( 1 ) // Remove first line which has the form "Error: TypeError"
14
16
. find ( frame => ! frame . includes ( 'node_modules/' ) ) // Ignore frames from 3rd party libraries
15
17
16
- return `${ getFrameLocation ( firstClientCodeFrame ) } \n`
18
+ return chalk . gray ( `${ getFrameLocation ( firstClientCodeFrame ) } \n` )
17
19
}
18
20
19
21
export { getUserTrace }
You can’t perform that action at this time.
0 commit comments