Add missing Date to cy.clock typescript def (#4106)

* add missing option from clock tsdef

* add type test for cy.clock with Date
This commit is contained in:
Zach Bloomquist
2019-05-03 01:04:16 -04:00
committed by Jennifer Shehane
parent 3394ea990a
commit 146d4cd5cf
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -510,7 +510,7 @@ declare namespace Cypress {
* // keep current date but override "setTimeout" and "clearTimeout"
* cy.clock(null, ['setTimeout', 'clearTimeout'])
*/
clock(now: number, functions?: Array<'setTimeout' | 'clearTimeout' | 'setInterval' | 'clearInterval'>, options?: Loggable): Chainable<Clock>
clock(now: number, functions?: Array<'setTimeout' | 'clearTimeout' | 'setInterval' | 'clearInterval' | 'Date'>, options?: Loggable): Chainable<Clock>
/**
* Mocks global clock and all functions.
*
+3
View File
@@ -271,3 +271,6 @@ namespace CypressTriggerTests {
arbitraryProperty: 0
})
}
const now = new Date(2019, 3, 2).getTime()
cy.clock(now, ['Date'])