Skip to content

Commit 678c901

Browse files
committed
fix(ts): validate d.ts beforerunning test
fixed #497
1 parent 6f3f609 commit 678c901

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"url": "https://github.com/leancloud/javascript-sdk"
99
},
1010
"scripts": {
11-
"test": "NODE_ENV=test nyc --reporter lcov --reporter text mocha --timeout 300000 test/index.js",
11+
"lint": "tsc storage.d.ts",
12+
"test": "npm run lint && npm run test:node",
13+
"test:node": "NODE_ENV=test nyc --reporter lcov --reporter text mocha --timeout 300000 test/index.js",
1214
"docs": "jsdoc src README.md package.json -d docs -c .jsdocrc.json",
1315
"build:node": "gulp babel-node",
1416
"build:browser": "CLIENT_PLATFORM=Browser webpack --config webpack/browser.js",
@@ -51,6 +53,7 @@
5153
"nyc": "^8.1.0",
5254
"qiniu": "^6.1.11",
5355
"should": "^11.1.0",
56+
"typescript": "^2.4.1",
5457
"weapp-polyfill": "^1.1.0",
5558
"webpack": "^2.2.0-rc.3"
5659
},

storage.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
interface IteratorResult<T> {
2+
done: boolean;
3+
value: T;
4+
}
15
interface AsyncIterator<T> {
26
next(): Promise<IteratorResult<T>>
37
}
@@ -553,7 +557,6 @@ declare namespace AV {
553557
signUp(attrs?: any, options?: AuthOptions): Promise<User>;
554558
logIn(options?: AuthOptions): Promise<User>;
555559
linkWithWeapp(): Promise<User>;
556-
fetch(options?: AuthOptions): Promise<User>;
557560
isAuthenticated(): Promise<boolean>;
558561
isCurrent(): boolean;
559562

0 commit comments

Comments
 (0)