<commit_before>/**
 * Copyright (c) 2013-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @emails oncall+relay
 */

'use strict';

const RelayTestUtils = require('RelayTestUtils');

describe('RelayTestUtils', () => {
  describe('matchers', () => {
    let comparator;

    beforeEach(() => {
      comparator = RelayTestUtils.matchers.toMatchRecord().compare;

      // Define custom matchers to test our custom matchers...
      jest.addMatchers({
        toFail() {
          return {
            compare(actual, expected) {
              if (actual.pass) {
                if (expected) {
                  return {
                    pass: false,
                    message: (
                      'Expected matcher to fail with message: ' +
                      JSON.stringify(expected) +
                      ' but it passed.'
                    ),
                  };
                } else {
                  return {
                    pass: false,
                    message: 'Expected matcher to fail but it passed.',<commit_msg>Unbreak more internal tests<commit_after>/**
 * Copyright (c) 2013-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @emails oncall+relay
 */

'use strict';

const RelayTestUtils = require('RelayTestUtils');

describe('RelayTestUtils', () => {
  describe('matchers', () => {
    let comparator;

    beforeEach(() => {
      comparator = RelayTestUtils.matchers.toMatchRecord().compare;

      // Define custom matchers to test our custom matchers...
      jasmine.addMatchers({
        toFail() {
          return {
            compare(actual, expected) {
              if (actual.pass) {
                if (expected) {
                  return {
                    pass: false,
                    message: (
                      'Expected matcher to fail with message: ' +
                      JSON.stringify(expected) +
                      ' but it passed.'
                    ),
                  };
                } else {
                  return {
                    pass: false,
                    message: 'Expected matcher to fail but it passed.',
{'fraction_non_alphanumeric': 0.09424488219389726, 'fraction_numerical': 0.003089996137504828, 'mean_word_length': 1.5848303393213572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1073086', 'n_tokens_mistral': 663, 'n_tokens_neox': 617, 'n_words': 212}