codeceptjs
Version:
Supercharged End 2 End Testing Framework for NodeJS
18 lines (15 loc) • 472 B
JavaScript
import output from '../output.js'
import screenshot from './screenshot.js'
let warned = false
/**
* Saves a screenshot when a test fails.
*
* **Deprecated:** use the `screenshot` plugin with `on: 'fail'`, which is the default behavior.
*/
export default function (config = {}) {
if (!warned) {
output.error('screenshotOnFail is deprecated; use the `screenshot` plugin (default on=fail).')
warned = true
}
return screenshot({ ...config, on: 'fail' })
}