<commit_before>const fs = require('fs');
const path = require('path');
const { EXT_PATTERN, IGNORE_PATHS } = require('./constants');

// Package: Run in root
// Workspaces: Run in root
const { tool } = process.beemo;
const { react } = tool.config.settings;
const workspacesEnabled = !!tool.package.workspaces;
const setupFilePath = path.join(process.cwd(), './tests/setup.ts');
const snapshotSerializers = [];
const setupFiles = [];
const roots = [];

if (workspacesEnabled) {
  roots.push('<rootDir>/packages');
} else {
  roots.push('<rootDir>');
}

if (react) {
  setupFiles.push(path.join(__dirname, './jest/enzyme.js'));
  snapshotSerializers.push('enzyme-to-json/serializer');
}

module.exports = {
  coverageDirectory: './coverage',
  coveragePathIgnorePatterns: [...IGNORE_PATHS],
  coverageReporters: ['lcov'],
  coverageThreshold: {
    global: {
      branches: 90,
      functions: 90,
      lines: 90,
      statements: 90,
    },
    [`${workspacesEnabled ? './packages/*/' : './'}src/**/*.${EXT_PATTERN}`]: {
      branches: 80,
      functions: 90,
      lines: 90,
      statements: 90,
    },
  },
  globals: {
    __DEV__: true,
  },
  roots,
  setupFiles,
  setupTestFrameworkScriptFile: fs.existsSync(setupFilePath) ? setupFilePath : undefined,
  snapshotSerializers,
  testURL: 'http://localhost',
  verbose: false,
};
<commit_msg>Use new setupFilesAfterEnv.<commit_after>const fs = require('fs');
const path = require('path');
const { EXT_PATTERN, IGNORE_PATHS } = require('./constants');

// Package: Run in root
// Workspaces: Run in root
const { tool } = process.beemo;
const { react } = tool.config.settings;
const workspacesEnabled = !!tool.package.workspaces;
const setupFilePath = path.join(process.cwd(), './tests/setup.ts');
const snapshotSerializers = [];
const setupFilesAfterEnv = [];
const setupFiles = [];
const roots = [];

if (workspacesEnabled) {
  roots.push('<rootDir>/packages');
} else {
  roots.push('<rootDir>');
}

if (react) {
  setupFiles.push(path.join(__dirname, './jest/enzyme.js'));
  snapshotSerializers.push('enzyme-to-json/serializer');
}

if (fs.existsSync(setupFilePath)) {
  setupFilesAfterEnv.push(setupFilePath);
}

module.exports = {
  coverageDirectory: './coverage',
  coveragePathIgnorePatterns: [...IGNORE_PATHS],
  coverageReporters: ['lcov'],
  coverageThreshold: {
    global: {
      branches: 90,
      functions: 90,
      lines: 90,
      statements: 90,
    },
    [`${workspacesEnabled ? './packages/*/' : './'}src/**/*.${EXT_PATTERN}`]: {
      branches: 80,
      functions: 90,
      lines: 90,
      statements: 90,
    },
  },
  globals: {
    __DEV__: true,
  },
  roots,
  setupFiles,
  setupFilesAfterEnv,
  snapshotSerializers,
  testURL: 'http://localhost',
  verbose: false,
};

{'fraction_non_alphanumeric': 0.1714905933429812, 'fraction_numerical': 0.011577424023154847, 'mean_word_length': 3.7508591065292096, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4204874', 'n_tokens_mistral': 942, 'n_tokens_neox': 903, 'n_words': 182}