mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Integration tests
This commit is contained in:
@ -52,9 +52,12 @@ func (ctl *Controller) PrintCalls() {
|
||||
|
||||
func (ctl *Controller) WasCalled(method, path string, expectedRequest []byte) bool {
|
||||
for _, call := range ctl.calls {
|
||||
if call.method != method && call.path != path {
|
||||
if call.method != method || call.path != path {
|
||||
continue
|
||||
}
|
||||
if string(expectedRequest) == "" {
|
||||
return true
|
||||
}
|
||||
diff, _ := jsondiff.Compare(call.request, expectedRequest, &jsondiff.Options{})
|
||||
isSuperset := diff == jsondiff.FullMatch || diff == jsondiff.SupersetMatch
|
||||
if isSuperset {
|
||||
|
||||
Reference in New Issue
Block a user