Skip to content

Commit c813e36

Browse files
authored
Merge branch 'develop' into cypress-json
2 parents 243cd31 + 35be2ae commit c813e36

File tree

5 files changed

+34
-21
lines changed

5 files changed

+34
-21
lines changed

cli/types/cypress.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ declare namespace Cypress {
18721872
* // or use this shortcut
18731873
* cy.tick(5000).invoke('restore')
18741874
*/
1875-
tick(milliseconds: number): Chainable<Clock>
1875+
tick(milliseconds: number, options?: Partial<Loggable>): Chainable<Clock>
18761876

18771877
/**
18781878
* Get the `document.title` property of the page that is currently active.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"gulp-debug": "4.0.0",
143143
"gulp-rename": "1.4.0",
144144
"hasha": "5.0.0",
145-
"http-server": "0.12.1",
145+
"http-server": "0.12.3",
146146
"human-interval": "1.0.0",
147147
"husky": "2.4.1",
148148
"inquirer": "3.3.0",

packages/driver/cypress/integration/commands/clock_spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ describe('src/cy/commands/clock', () => {
461461
expect(log.get('snapshots')[1].name).to.equal('after')
462462
})
463463
})
464+
465+
it('does not emit when {log: false}', () => {
466+
cy
467+
.clock()
468+
.tick(10, { log: false })
469+
.then(function () {
470+
expect(this.logs[0]).to.be.undefined
471+
})
472+
})
464473
})
465474
})
466475
})

packages/driver/src/cy/commands/clock.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module.exports = function (Commands, Cypress, cy, state) {
9797

9898
const { tick } = clock
9999

100-
clock.tick = function (ms) {
100+
clock.tick = function (ms, options = {}) {
101101
if ((ms != null) && !_.isNumber(ms)) {
102102
$errUtils.throwErrByPath('tick.invalid_argument', { args: { arg: JSON.stringify(ms) } })
103103
}
@@ -106,10 +106,14 @@ module.exports = function (Commands, Cypress, cy, state) {
106106
ms = 0
107107
}
108108

109-
const theLog = log('tick', `${ms}ms`, false, {
110-
'Now': clock.details().now + ms,
111-
'Ticked': `${ms} milliseconds`,
112-
})
109+
let theLog
110+
111+
if (options.log !== false) {
112+
theLog = log('tick', `${ms}ms`, false, {
113+
'Now': clock.details().now + ms,
114+
'Ticked': `${ms} milliseconds`,
115+
})
116+
}
113117

114118
if (theLog) {
115119
theLog.snapshot('before', { next: 'after' })
@@ -151,12 +155,12 @@ module.exports = function (Commands, Cypress, cy, state) {
151155
return clock
152156
},
153157

154-
tick (subject, ms) {
158+
tick (subject, ms, options = {}) {
155159
if (!clock) {
156160
$errUtils.throwErrByPath('tick.no_clock')
157161
}
158162

159-
clock.tick(ms)
163+
clock.tick(ms, options)
160164

161165
return clock
162166
},

yarn.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11590,7 +11590,7 @@ colors@1.1.2:
1159011590
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
1159111591
integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM=
1159211592

11593-
colors@^1.1.2, colors@^1.2.1, colors@^1.3.2, colors@^1.3.3:
11593+
colors@^1.1.2, colors@^1.2.1, colors@^1.3.2, colors@^1.4.0:
1159411594
version "1.4.0"
1159511595
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
1159611596
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
@@ -18903,7 +18903,7 @@ http-proxy-middleware@^0.19.1:
1890318903
lodash "^4.17.11"
1890418904
micromatch "^3.1.10"
1890518905

18906-
http-proxy@1.18.1, http-proxy@^1.17.0, http-proxy@^1.18.1:
18906+
http-proxy@1.18.1, http-proxy@^1.17.0, http-proxy@^1.18.0, http-proxy@^1.18.1:
1890718907
version "1.18.1"
1890818908
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
1890918909
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
@@ -18920,19 +18920,19 @@ http-proxy@cypress-io/node-http-proxy#9322b4b69b34f13a6f3874e660a35df3305179c6:
1892018920
follow-redirects "^1.0.0"
1892118921
requires-port "^1.0.0"
1892218922

18923-
http-server@0.12.1:
18924-
version "0.12.1"
18925-
resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.12.1.tgz#629ae9a8c786587ee21b0ff087b670f69b809d8c"
18926-
integrity sha512-T0jB+7J7GJ2Vo+a4/T7P7SbQ3x2GPDnqRqQXdfEuPuUOmES/9NBxPnDm7dh1HGEeUWqUmLUNtGV63ZC5Uy3tGA==
18923+
http-server@0.12.3:
18924+
version "0.12.3"
18925+
resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.12.3.tgz#ba0471d0ecc425886616cb35c4faf279140a0d37"
18926+
integrity sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==
1892718927
dependencies:
1892818928
basic-auth "^1.0.3"
18929-
colors "^1.3.3"
18929+
colors "^1.4.0"
1893018930
corser "^2.0.1"
1893118931
ecstatic "^3.3.2"
18932-
http-proxy "^1.17.0"
18932+
http-proxy "^1.18.0"
18933+
minimist "^1.2.5"
1893318934
opener "^1.5.1"
18934-
optimist "~0.6.1"
18935-
portfinder "^1.0.20"
18935+
portfinder "^1.0.25"
1893618936
secure-compare "3.0.1"
1893718937
union "~0.5.0"
1893818938

@@ -25651,7 +25651,7 @@ opn@cypress-io/opn#2f4e9a216ca7bdb95dfae9d46d99ddf004b3cbb5:
2565125651
object-assign "^4.0.1"
2565225652
pinkie-promise "^2.0.0"
2565325653

25654-
optimist@0.6.1, optimist@^0.6.1, optimist@~0.6.1:
25654+
optimist@0.6.1, optimist@^0.6.1:
2565525655
version "0.6.1"
2565625656
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
2565725657
integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY=
@@ -26835,7 +26835,7 @@ popper.js@^1.14.1, popper.js@^1.15.0:
2683526835
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
2683626836
integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
2683726837

26838-
portfinder@^1.0.17, portfinder@^1.0.20, portfinder@^1.0.25, portfinder@^1.0.26, portfinder@^1.0.9:
26838+
portfinder@^1.0.17, portfinder@^1.0.25, portfinder@^1.0.26, portfinder@^1.0.9:
2683926839
version "1.0.28"
2684026840
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
2684126841
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==

0 commit comments

Comments
 (0)