<commit_before>require 'window'

measure 'spec suite require time', ->
  fs = require 'fs'
  fsUtils = require 'fs-utils'
  path = require 'path'
  _ = require 'underscore'
  require 'spec-helper'

  requireSpecs = (directoryPath, specType) ->
    for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath
      require specPath

  setSpecType = (specType) ->
    for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType?
      spec.specType = specType

  # Run core specs
  requireSpecs(window.resourcePath)
  setSpecType('core')

  fixturesPackagesPath = fsUtils.resolveOnLoadPath('fixtures/packages')
  packagePaths = atom.getAvailablePackageNames().map (packageName) -> atom.resolvePackagePath(packageName)
  packagePaths = _.groupBy packagePaths, (packagePath) ->
    if packagePath.indexOf("#{fixturesPackagesPath}#{path.sep}") is 0
      'fixtures'
    else if packagePath.indexOf("#{window.resourcePath}#{path.sep}") is 0
      'bundled'
    else
      'user'

  # Run bundled package specs
  requireSpecs(packagePath) for packagePath in packagePaths.bundled
  setSpecType('bundled')

  # Run user package specs
  requireSpecs(packagePath) for packagePath in packagePaths.user
  setSpecType('user')<commit_msg>Default to empty arrays for user and bundled package paths<commit_after>require 'window'

measure 'spec suite require time', ->
  fs = require 'fs'
  fsUtils = require 'fs-utils'
  path = require 'path'
  _ = require 'underscore'
  require 'spec-helper'

  requireSpecs = (directoryPath, specType) ->
    for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath
      require specPath

  setSpecType = (specType) ->
    for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType?
      spec.specType = specType

  # Run core specs
  requireSpecs(window.resourcePath)
  setSpecType('core')

  fixturesPackagesPath = fsUtils.resolveOnLoadPath('fixtures/packages')
  packagePaths = atom.getAvailablePackageNames().map (packageName) -> atom.resolvePackagePath(packageName)
  packagePaths = _.groupBy packagePaths, (packagePath) ->
    if packagePath.indexOf("#{fixturesPackagesPath}#{path.sep}") is 0
      'fixtures'
    else if packagePath.indexOf("#{window.resourcePath}#{path.sep}") is 0
      'bundled'
    else
      'user'

  # Run bundled package specs
  requireSpecs(packagePath) for packagePath in packagePaths.bundled ? []
  setSpecType('bundled')

  # Run user package specs
  requireSpecs(packagePath) for packagePath in packagePaths.user ? []
  setSpecType('user')
{'fraction_non_alphanumeric': 0.11419870574800152, 'fraction_numerical': 0.0015226494099733537, 'mean_word_length': 4.341463414634147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7449991', 'n_tokens_mistral': 813, 'n_tokens_neox': 787, 'n_words': 192}