File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ describe("vscode", () => {
66
66
67
67
_document . body . removeChild ( mockElement )
68
68
} )
69
- it ( "should return have loadBundle property if _resolvedLangaugePackCoreLocation" , async ( ) => {
69
+ it ( "should return and have a loadBundle property if _resolvedLangaugePackCoreLocation" , async ( ) => {
70
70
const mockElement = _document . createElement ( "div" )
71
71
const dataSettings = {
72
72
locale : "en" ,
@@ -99,6 +99,11 @@ describe("vscode", () => {
99
99
expect ( mockCallbackFn ) . toHaveBeenCalledWith ( undefined , { key : "hello world" } )
100
100
// 4. call it again and calls the callback with the cached json
101
101
102
+ fetchMock . mockReject ( new Error ( "fake error message" ) )
103
+ const mockCallbackFn2 = jest . fn ( ( error ) => error )
104
+ const error = await nlsConfig . loadBundle ( "goodbye" , "es" , mockCallbackFn2 )
105
+ expect ( error . message ) . toEqual ( "fake error message" )
106
+
102
107
_document . body . removeChild ( mockElement )
103
108
} )
104
109
} )
You can’t perform that action at this time.
0 commit comments