<commit_before>/*global expect*/
describe('function type', function() {
  it('should inspect an empty anonymous function correctly', function() {
    expect(function() {}, 'to inspect as', 'function () {}');
  });

  it('should inspect an empty named function correctly', function() {
    expect(function foo() {}, 'to inspect as', 'function foo() {}');
  });

  it('should inspect a function with a custom toString correctly', function() {
    var fn = function foo() {};
    fn.toString = 'breakage';
    expect(fn, 'to inspect as', 'function foo() {}');
  });

  var isNodeJs3OrBelow =
    typeof process === 'object' && /^v[0123]\./.test(process.version);
  var isPhantomJs =
    typeof navigator !== 'undefined' && /phantom/i.test(navigator.userAgent);
  if (!isNodeJs3OrBelow && !isPhantomJs) {
    // Node.js 3 and below and phantom.js don't include "bound " and the
    // old Phantom.js version that's currently available on Travis doesn't
    // even have Function#bind, which we then polyfill via es5-shim, leading
    // to even more different output.
    // For now let's just disable these tests in those environments

    it('should inspect an anonymous bound function correctly', function() {
      expect(
        // eslint-disable-next-line no-extra-bind
        function() {}.bind({}),
        'to inspect as',<commit_msg>Remove node.js < 3 guard from function tests<commit_after>/*global expect*/
describe('function type', function() {
  it('should inspect an empty anonymous function correctly', function() {
    expect(function() {}, 'to inspect as', 'function () {}');
  });

  it('should inspect an empty named function correctly', function() {
    expect(function foo() {}, 'to inspect as', 'function foo() {}');
  });

  it('should inspect a function with a custom toString correctly', function() {
    var fn = function foo() {};
    fn.toString = 'breakage';
    expect(fn, 'to inspect as', 'function foo() {}');
  });

  var isPhantomJs =
    typeof navigator !== 'undefined' && /phantom/i.test(navigator.userAgent);
  if (!isPhantomJs) {
    // Node.js 3 and below and phantom.js don't include "bound " and the
    // old Phantom.js version that's currently available on Travis doesn't
    // even have Function#bind, which we then polyfill via es5-shim, leading
    // to even more different output.
    // For now let's just disable these tests in those environments

    it('should inspect an anonymous bound function correctly', function() {
      expect(
        // eslint-disable-next-line no-extra-bind
        function() {}.bind({}),
        'to inspect as',
{'fraction_non_alphanumeric': 0.14291217257318953, 'fraction_numerical': 0.00423728813559322, 'mean_word_length': 3.4016949152542373, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '950948', 'n_tokens_mistral': 739, 'n_tokens_neox': 700, 'n_words': 260}