How to use the testcafe.t function in testcafe

To help you get started, we’ve selected a few testcafe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TheBrainFamily / TheBrain2.0 / testing / testHelpers / startAppTestCafe.js View on Github external
const TestCafeDriver = require('./TestCafeDriver').TestCafeDriver
const t = require('testcafe').t

// TODO extract this to separate function
const stringify = function (obj) {
  return JSON.stringify(obj, function (key, value) {
    var fnBody
    if (value instanceof Function || typeof value === 'function') {
      fnBody = value.toString()

      if (fnBody.length < 8 || fnBody.substring(0, 8) !== 'function') { // this is ES6 Arrow Function
        return '_NuFrRa_' + fnBody
      }
      return fnBody
    }
    if (value instanceof RegExp) {
      return '_PxEgEr_' + value
    }