Skip to content

Commit 5f66abe

Browse files
committed
fix(ts): validate d.ts beforerunning test
fixed #497
1 parent eef9235 commit 5f66abe

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",
@@ -50,6 +52,7 @@
5052
"nyc": "^8.1.0",
5153
"should": "^11.1.0",
5254
"uglify-js": "git+https://github.com/Swaagie/UglifyJS2.git#fcb4f2f21584dc5b21af4c10e17733e1686135e4",
55+
"typescript": "^2.4.1",
5356
"weapp-polyfill": "^1.1.0",
5457
"webpack": "^2.2.0-rc.3"
5558
},

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
}
@@ -540,7 +544,6 @@ declare namespace AV {
540544
signUp(attrs?: any, options?: AuthOptions): Promise<User>;
541545
logIn(options?: AuthOptions): Promise<User>;
542546
linkWithWeapp(): Promise<User>;
543-
fetch(options?: AuthOptions): Promise<User>;
544547
isAuthenticated(): Promise<boolean>;
545548
isCurrent(): boolean;
546549

0 commit comments

Comments
 (0)