refs #714 Fix tests for axiosCancelToken

This commit is contained in:
AkiraFukushima 2021-04-05 01:02:54 +09:00
parent e2518d5af4
commit d047c7242b
4 changed files with 28 additions and 4 deletions

View file

@ -116,7 +116,13 @@ const toot: MastodonEntity.Notification = {
;(axios.CancelToken.source as any).mockImplementation(() => {
return {
token: 'cancelToken'
token: {
throwIfRequested: () => {},
promise: {
then: () => {},
catch: () => {}
}
}
}
})

View file

@ -63,7 +63,13 @@ const status: Entity.Status = {
}
;(axios.CancelToken.source as any).mockImplementation(() => {
return {
token: 'cancelToken'
token: {
throwIfRequested: () => {},
promise: {
then: () => {},
catch: () => {}
}
}
}
})

View file

@ -123,7 +123,13 @@ const groupInvited: MisskeyEntity.Notification = {
;(axios.CancelToken.source as any).mockImplementation(() => {
return {
token: 'cancelToken'
token: {
throwIfRequested: () => {},
promise: {
then: () => {},
catch: () => {}
}
}
}
})

View file

@ -121,7 +121,13 @@ const followRequest: PleromaEntity.Notification = {
;(axios.CancelToken.source as any).mockImplementation(() => {
return {
token: 'cancelToken'
token: {
throwIfRequested: () => {},
promise: {
then: () => {},
catch: () => {}
}
}
}
})