Files
atom/spec/spec-suite.coffee
Kevin Sawicki 599a2ad021 Group specs into four sections
1. Core specs located in spec/
2. Internal package specs in src/packages
3. Bundled package specs in node_modules
4. User package specs in ~/.atom/packages
2013-08-09 17:24:07 -07:00

28 lines
957 B
CoffeeScript

require 'window'
measure 'spec suite require time', ->
fsUtils = require 'fs-utils'
path = require 'path'
require 'spec-helper'
requireSpecs = (directoryPath, specType) ->
for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath
require specPath
for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType?
spec.specType = specType
# Run core specs
requireSpecs(window.resourcePath, 'core')
# Run internal package specs
for packagePath in fsUtils.listTreeSync(config.bundledPackagesDirPath)
requireSpecs(packagePath, 'internal')
# Run bundled package specs
for packagePath in fsUtils.listTreeSync(config.nodeModulesDirPath) when atom.isInternalPackage(packagePath)
requireSpecs(packagePath, 'bundled')
# Run user package specs
for packagePath in fsUtils.listTreeSync(config.userPackagesDirPath)
requireSpecs(packagePath, 'user')