UNPKG

@beemo/driver-jest

Version:
63 lines (47 loc) 3.4 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const core = require('@beemo/core'); // Success: // Writes passed tests to stderr (Bug? https://github.com/facebook/jest/issues/5064) // Writes coverage to stdout // Failure: Writes failed tests to stderr class JestDriver extends core.Driver { constructor(...args) { super(...args); this.name = '@beemo/driver-jest'; } bootstrap() { this.setMetadata({ bin: 'jest', configName: 'jest.config.js', dependencies: [], description: this.tool.msg('app:jestDescription'), title: 'Jest', watchOptions: ['--watch', '--watchAll'] }); } getDependencies() { const deps = super.getDependencies(); if (this.tool.driverRegistry.isRegistered('babel') && !deps.includes('babel')) { deps.push('babel'); } return deps; } // https://github.com/nodejs/node/issues/19218 // istanbul ignore next getSupportedOptions() { return ['--all', '--automock', '-b', '--bail', '--browser', '-c', '--cache', '--cacheDirectory', '--changedFilesWithAncestor', '--changedSince', '--ci', '--clearCache', '--clearMocks', '--collectCoverage', '--collectCoverageFrom', '--collectCoverageOnlyFrom', '--color', '--colors', '--config', '--coverage', '--coverageDirectory', '--coveragePathIgnorePatterns', '--coverageProvider', '--coverageReporters', '--coverageThreshold', '--debug', '--detectLeaks', '--detectOpenHandles', '-e', '--env', '--errorOnDeprecated', '--expand', '-f', '--filter', '--findRelatedTests', '--forceExit', '--globalSetup', '--globalTeardown', '--globals', '--haste', '-h', '--help', '-i', '--init', '--injectGlobals', '--json', '--lastCommit', '--listTests', '--logHeapUsage', '--mapCoverage', '--maxConcurrency', '--maxWorkers', '--moduleDirectories', '--moduleFileExtensions', '--moduleNameMapper', '--modulePathIgnorePatterns', '--modulePaths', '--no-cache', '--no-watchman', '--noStackTrace', '--notify', '--notifyMode', '-o', '--onlyChanged', '--onlyFailures', '--outputFile', '--passWithNoTests', '--preset', '--prettierPath', '--projects', '--reporters', '--resetMocks', '--resetModules', '--resolver', '--restoreMocks', '--rootDir', '--roots', '--runInBand', '--runner', '--runTestsByPath', '--selectProjects', '--setupFiles', '--setupFilesAfterEnv', '--showConfig', '--silent', '--skipFilter', '--snapshotSerializers', '-t', '--testEnvironment', '--testEnvironmentOptions', '--testFailureExitCode', '--testLocationInResults', '--testMatch', '--testNamePattern', '--testPathIgnorePatterns', '--testPathPattern', '--testRegex', '--testResultsProcessor', '--testRunner', '--testSequencer', '--testTimeout', '--testURL', '--timers', '--transform', '--transformIgnorePatterns', '-u', '--unmockedModulePathPatterns', '--updateSnapshot', '--useStderr', '-v', '--verbose', '--version', '-w', '--watch', '--watchAll', '--watchPathIgnorePatterns', '--watchman']; } processSuccess(response) { var _response$command; const out = response.stdout.trim(); const err = response.stderr.trim(); if ((_response$command = response.command) !== null && _response$command !== void 0 && _response$command.includes('--coverage')) { this.setOutput('stdout', `${err}\n${out}`); } else if (err) { this.setOutput('stdout', err); } } } exports.JestDriver = JestDriver; //# sourceMappingURL=JestDriver.js.map