cypress-failed-log
Version:
Gets you the Cypress test command log as JSON on failure
18 lines (12 loc) • 400 B
JavaScript
/// <reference types="cypress" />
const util = require('util')
const useSingleQuotes = s =>
Cypress._.replace(Cypress._.replace(s, /'/g, "\\'"), /"/g, "'")
const stringify = x => useSingleQuotes(JSON.stringify(util.inspect(x)))
const isSimple = x =>
Cypress._.isString(x) || Cypress._.isNumber(x) || Cypress._.isPlainObject(x)
module.exports = {
useSingleQuotes,
isSimple,
stringify
}