Skip to content

Commit f30238b

Browse files
Remove call to deprecated Cypress.moment() (#388)
1 parent a17eb74 commit f30238b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"check-code-coverage": "1.10.0",
6767
"console-log-div": "0.6.3",
6868
"cypress": "6.3.0",
69+
"dayjs": "^1.10.4",
6970
"express": "4.17.1",
7071
"lodash": "4.17.20",
7172
"markdown-link-check": "3.8.6",

support.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/// <reference types="cypress" />
22
// @ts-check
33

4+
const dayjs = require('dayjs')
5+
var duration = require('dayjs/plugin/duration')
46
const { filterSpecsFromCoverage } = require('./support-utils')
57

8+
dayjs.extend(duration)
9+
610
/**
711
* Sends collected code coverage object to the backend code
812
* via "cy.task".
@@ -226,7 +230,7 @@ const registerHooks = () => {
226230
message: ['Generating report [@cypress/code-coverage]']
227231
})
228232
cy.task('coverageReport', null, {
229-
timeout: Cypress.moment.duration(3, 'minutes').asMilliseconds(),
233+
timeout: dayjs.duration(3, 'minutes').asMilliseconds(),
230234
log: false
231235
}).then((coverageReportFolder) => {
232236
logInstance.set('consoleProps', () => ({

0 commit comments

Comments
 (0)