Skip to content

Commit 5361735

Browse files
authored
feat: run cypress info command after install and verify (#104)
1 parent a9c85b3 commit 5361735

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/index.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async function install(arg) {
126126
}
127127
}
128128

129-
async function verify(arg) {
129+
async function cypressVerify(arg) {
130130
debug('verifying Cypress can run')
131131
try {
132132
await arg.utils.run('cypress', ['verify'])
@@ -140,6 +140,20 @@ async function verify(arg) {
140140
}
141141
}
142142

143+
async function cypressInfo(arg) {
144+
debug('Cypress info')
145+
try {
146+
await arg.utils.run('cypress', ['info'])
147+
} catch (error) {
148+
debug('error in Cypress info command: %s', error.message)
149+
const buildUtils = arg.utils.build
150+
console.error('')
151+
console.error('Failed to run Cypress info')
152+
console.error('')
153+
buildUtils.failBuild('Failed Cypress info', { error })
154+
}
155+
}
156+
143157
const processCypressResults = (results, buildUtils) => {
144158
if (results.failures) {
145159
// Cypress failed without even running the tests
@@ -199,7 +213,8 @@ const hasRecordKey = () => typeof process.env.CYPRESS_RECORD_KEY === 'string'
199213
module.exports = {
200214
onPreBuild: async (arg) => {
201215
await install(arg)
202-
await verify(arg)
216+
await cypressVerify(arg)
217+
await cypressInfo(arg)
203218

204219
debug('cypress plugin preBuild inputs %o', arg.inputs)
205220
const preBuildInputs = arg.inputs && arg.inputs.preBuild

0 commit comments

Comments
 (0)