File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ describe("vscode", () => {
6666
6767 _document . body . removeChild ( mockElement )
6868 } )
69- it ( "should return have loadBundle property if _resolvedLangaugePackCoreLocation" , async ( ) => {
69+ it ( "should return and have a loadBundle property if _resolvedLangaugePackCoreLocation" , async ( ) => {
7070 const mockElement = _document . createElement ( "div" )
7171 const dataSettings = {
7272 locale : "en" ,
@@ -99,6 +99,11 @@ describe("vscode", () => {
9999 expect ( mockCallbackFn ) . toHaveBeenCalledWith ( undefined , { key : "hello world" } )
100100 // 4. call it again and calls the callback with the cached json
101101
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+
102107 _document . body . removeChild ( mockElement )
103108 } )
104109 } )
You can’t perform that action at this time.
0 commit comments