function buildTestCafeAssertionName(assertionName, options) {
  const opts = new Options(options, { defaults: { isNot: false } });
  const { isNot } = opts;

  if (!isNonBlankString(assertionName)) {
    throw new TypeError(
      `'assertionName' argument must be a non-blank string but it is ${typeOf(assertionName)} (${assertionName})`
    );
  }

  assertionName = _.trim(assertionName);

  if (!_.includes(testCafeAssertionNames, assertionName)) {
    throw new TypeError(
      `TestCafe doesn't provide '${assertionName}' assertion`
    );
  }

  if (isNot) {
    if (assertionName === 'gt') {
      assertionName = 'lte';
    }
    else if (assertionName === 'gte') {
      assertionName = 'lt';
    }
    else if (assertionName === 'lt') {
      assertionName = 'gte';
    }
    else if (assertionName === 'lte') {
      assertionName = 'gt';
    }
    else if (_.startsWith(assertionName, 'not')) {
      assertionName = assertionName.substr(3);
      assertionName = lcFirst(assertionName);
    }
    else {
      assertionName = ucFirst(assertionName);
      assertionName = 'not' + assertionName;
    }
  }

  return assertionName;
}
/**
 * Checks that TestCafe provides assertion with specified name and returns it.
 * Note that check is done after whitespaces trimmed down from both sides of
 * `assertionName` argument. Also see `options` for available transformations
 * and etc.
 *
 * @param {string} assertionName - Name of TestCafe assertion
 * @param {?Options} [options] - Options
 * @param {boolean} [options.isNot=false] - When truthy assertion name would be negated, for example, 'eql' would be toggled to 'notEql'
 * @returns {string} Returns TestCafe assertion name
 * @throws {TypeError} When arguments aren't valid.
 */
Checks that TestCafe provides assertion with specified name and returns it.
Note that check is done after whitespaces trimmed down from both sides of
`assertionName` argument. Also see `options` for available transformations
and etc.


Checks that TestCafe provides assertion with specified name and returns it . Note that check is done after whitespaces trimmed down from both sides of ` assertionName ` argument . Also see ` options ` for available transformations and etc .
function buildTestCafeAssertionName(assertionName, options) {
  const opts = new Options(options, { defaults: { isNot: false } });
  const { isNot } = opts;
  if (!isNonBlankString(assertionName)) {
    throw new TypeError(
      `'assertionName' argument must be a non-blank string but it is ${typeOf(assertionName)} (${assertionName})`
    );
  }
  assertionName = _.trim(assertionName);
  if (!_.includes(testCafeAssertionNames, assertionName)) {
    throw new TypeError(
      `TestCafe doesn't provide '${assertionName}' assertion`
    );
  }
  if (isNot) {
    if (assertionName === 'gt') {
      assertionName = 'lte';
    }
    else if (assertionName === 'gte') {
      assertionName = 'lt';
    }
    else if (assertionName === 'lt') {
      assertionName = 'gte';
    }
    else if (assertionName === 'lte') {
      assertionName = 'gt';
    }
    else if (_.startsWith(assertionName, 'not')) {
      assertionName = assertionName.substr(3);
      assertionName = lcFirst(assertionName);
    }
    else {
      assertionName = ucFirst(assertionName);
      assertionName = 'not' + assertionName;
    }
  }
  return assertionName;
}
function buildTestCafeAssertionName ( assertionName , options ) { const opts = new Options ( options , { defaults : { isNot : false } } ) ; const { isNot } = opts ; if ( ! isNonBlankString ( assertionName ) ) { throw new TypeError ( ` ${ typeOf ( assertionName ) } ${ assertionName } ` ) ; } assertionName = _ . trim ( assertionName ) ; if ( ! _ . includes ( testCafeAssertionNames , assertionName ) ) { throw new TypeError ( ` ${ assertionName } ` ) ; } if ( isNot ) { if ( assertionName === 'gt' ) { assertionName = 'lte' ; } else if ( assertionName === 'gte' ) { assertionName = 'lt' ; } else if ( assertionName === 'lt' ) { assertionName = 'gte' ; } else if ( assertionName === 'lte' ) { assertionName = 'gt' ; } else if ( _ . startsWith ( assertionName , 'not' ) ) { assertionName = assertionName . substr ( 3 ) ; assertionName = lcFirst ( assertionName ) ; } else { assertionName = ucFirst ( assertionName ) ; assertionName = 'not' + assertionName ; } } return assertionName ; }
Checks that TestCafe provides assertion with specified name and returns it.
Checks that TestCafe provides assertion with specified name and returns it .