flotwig / cypress-log-to-output

A Cypress plugin that sends all logs that occur in the browser to stdout in the terminal.
146 stars 19 forks source link

TypeError: Cannot read property 'recordLogs' of undefined #13

Closed colinbr96 closed 4 years ago

colinbr96 commented 4 years ago

Version: v1.1.0

Bug Summary: The Usage section of the README states that the plugin should be installed via: require('cypress-log-to-output').install(on)

However, this will cause a crash due to options not being passed to install. It appears install is written with the expectation that options is passed as an object:

function install(on, filter, options) {
  eventFilter = filter;
  recordLogs = options.recordLogs; // TypeError: Cannot read property 'recordLogs' of undefined
  on('before:browser:launch', browserLaunchHandler)
}

Workaround Install the plugin via: require('cypress-log-to-output').install(on, undefined, {})

ldeveber commented 4 years ago

We are also seeing this

flotwig commented 4 years ago

Please try upgrading to v1.1.1, where this has been fixed