Skip to content

Commit 5d76163

Browse files
NicholasBollbrian-mann
authored andcommitted
chore: Update type definitions to match API more closely (#1048)
* chore: Fill out Cypress API types * chore: Convert Chainable into a Generic with a subject * chore: undefined return of then keeps Subject * fix: Remove incorrect comment * chore: Add element keys to all selector methods * chore: Remove generic from cy.not - it doesn't make sense * chore: Add ChainableArray for array Subjects * chore: Add ChainerArray to thread types through * chore: Remove ChainableArray interface * chore: Fix stub/spy types - returns Agent interface
1 parent c1bcb2f commit 5d76163

File tree

5 files changed

+2226
-418
lines changed

5 files changed

+2226
-418
lines changed

cli/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@
2929
"@cypress/xvfb": "1.0.4",
3030
"@types/blob-util": "1.3.3",
3131
"@types/bluebird": "3.5.18",
32+
"@types/chai": "4.0.8",
33+
"@types/chai-jquery": "1.1.35",
3234
"@types/jquery": "3.2.16",
3335
"@types/lodash": "4.14.87",
3436
"@types/minimatch": "3.0.1",
37+
"@types/mocha": "2.2.44",
3538
"@types/sinon": "4.0.0",
39+
"@types/sinon-chai": "2.7.29",
3640
"bluebird": "3.5.0",
3741
"chalk": "2.1.0",
3842
"check-more-types": "2.24.0",

cli/types/chai.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Shim definition to export a namespace. Cypress is actually a global module
2+
// so import/export isn't allowed there. We import here and define a global module
3+
// tslint:disable-next-line:no-implicit-dependencies
4+
import * as chai from 'chai'
5+
6+
export = Chai
7+
export as namespace Chai
8+
9+
declare namespace Chai {
10+
type ChaiStatic = typeof chai
11+
type ExpectStatic = typeof chai.expect
12+
type AssertStatic = typeof chai.assert
13+
}

0 commit comments

Comments
 (0)