From d62f53ba8ce5b49a3d1e610c567aa9612d47fb83 Mon Sep 17 00:00:00 2001 From: rockSandy Date: Mon, 17 Aug 2020 16:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#46827=20[@types/mi?= =?UTF-8?q?niprogram]=20update=20callback=20fail=20object=20by=20@rockSand?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: update callback fail object * feat: add tests --- types/miniprogram/index.d.ts | 6 +++--- types/miniprogram/miniprogram-tests.ts | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/types/miniprogram/index.d.ts b/types/miniprogram/index.d.ts index c712f28ce2..93b0b3c30d 100644 --- a/types/miniprogram/index.d.ts +++ b/types/miniprogram/index.d.ts @@ -5,9 +5,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface AsyncCallbackFailObject { - errCode: string; - errorMessage: string; - [key: string]: string; + error: number; + errorMessage?: string; + [key: string]: any; } interface AsyncCallback { diff --git a/types/miniprogram/miniprogram-tests.ts b/types/miniprogram/miniprogram-tests.ts index dd83083892..bd8c9550c1 100644 --- a/types/miniprogram/miniprogram-tests.ts +++ b/types/miniprogram/miniprogram-tests.ts @@ -362,7 +362,12 @@ my.removeSavedFile({ apFilePath: '', }); -my.getLocation({}); +my.getLocation({ + fail(res) { + res.error; + res.errorMessage; + } +}); my.request({ url: '' });