@@ -13,7 +13,7 @@ describe("TestSubmissionClient", () => {
13
13
config . heartbeatServerUrl = "http://heartbeat.localhost:5000" ;
14
14
15
15
test ( "should submit events" , async ( ) => {
16
- const fetchMock = TestSubmissionClient . prototype . fetch = jest . fn ( )
16
+ const fetchMock = TestSubmissionClient . prototype . apiFetch = jest . fn ( )
17
17
. mockReturnValueOnce ( new Response ( 202 , "" , undefined , undefined , undefined ) ) ;
18
18
19
19
const events = [ { type : "log" , message : "From js client" , reference_id : "123454321" } ] ;
@@ -28,7 +28,7 @@ describe("TestSubmissionClient", () => {
28
28
} ) ;
29
29
30
30
test ( "should submit invalid object data" , async ( ) => {
31
- const fetchMock = TestSubmissionClient . prototype . fetch = jest . fn ( )
31
+ const fetchMock = TestSubmissionClient . prototype . apiFetch = jest . fn ( )
32
32
. mockReturnValueOnce ( new Response ( 202 , "" , undefined , undefined , undefined ) ) ;
33
33
34
34
const events : Event [ ] = [ {
@@ -49,7 +49,7 @@ describe("TestSubmissionClient", () => {
49
49
} ) ;
50
50
51
51
test ( "should submit user description" , async ( ) => {
52
- const fetchMock = TestSubmissionClient . prototype . fetch = jest . fn ( )
52
+ const fetchMock = TestSubmissionClient . prototype . apiFetch = jest . fn ( )
53
53
. mockReturnValueOnce ( new Response ( 202 , "" , undefined , 1 , undefined ) )
54
54
. mockReturnValueOnce ( new Response ( 202 , "" , undefined , undefined , JSON . stringify ( new ServerSettings ( { } , 1 ) ) ) ) ;
55
55
@@ -71,7 +71,7 @@ describe("TestSubmissionClient", () => {
71
71
} ) ;
72
72
73
73
test ( "should submit heartbeat" , async ( ) => {
74
- const fetchMock = TestSubmissionClient . prototype . fetch = jest . fn ( )
74
+ const fetchMock = TestSubmissionClient . prototype . apiFetch = jest . fn ( )
75
75
. mockReturnValueOnce ( new Response ( 200 , "" , undefined , undefined , undefined ) ) ;
76
76
77
77
const client = new TestSubmissionClient ( config ) ;
@@ -82,7 +82,7 @@ describe("TestSubmissionClient", () => {
82
82
} ) ;
83
83
84
84
test ( "should get project settings" , async ( ) => {
85
- const fetchMock = TestSubmissionClient . prototype . fetch = jest . fn ( )
85
+ const fetchMock = TestSubmissionClient . prototype . apiFetch = jest . fn ( )
86
86
. mockReturnValueOnce ( new Response ( 200 , "" , undefined , undefined , JSON . stringify ( new ServerSettings ( { } , 1 ) ) ) ) ;
87
87
88
88
const client = new TestSubmissionClient ( config ) ;
0 commit comments