diff --git a/packages/jest/src/builders/jest/jest.impl.spec.ts b/packages/jest/src/builders/jest/jest.impl.spec.ts index 21e796c364c385..bef0b4bde9bc20 100644 --- a/packages/jest/src/builders/jest/jest.impl.spec.ts +++ b/packages/jest/src/builders/jest/jest.impl.spec.ts @@ -111,7 +111,7 @@ describe('Jest Builder', () => { colors: false, reporters: ['/test/path'], verbose: false, - coverageReporters: 'test', + coverageReporters: ['test'], coverageDirectory: '/test/path', watch: false }, @@ -220,7 +220,7 @@ describe('Jest Builder', () => { colors: false, verbose: false, reporters: ['/test/path'], - coverageReporters: 'test', + coverageReporters: ['test'], coverageDirectory: '/test/path', testResultsProcessor: 'results-processor', updateSnapshot: true, diff --git a/packages/jest/src/builders/jest/jest.impl.ts b/packages/jest/src/builders/jest/jest.impl.ts index df955ffc826732..1a2de908d5bd91 100644 --- a/packages/jest/src/builders/jest/jest.impl.ts +++ b/packages/jest/src/builders/jest/jest.impl.ts @@ -107,7 +107,6 @@ function run( testPathPattern: options.testPathPattern, colors: options.colors, verbose: options.verbose, - coverageReporters: options.coverageReporters, coverageDirectory: options.coverageDirectory, testResultsProcessor: options.testResultsProcessor, updateSnapshot: options.updateSnapshot, @@ -141,6 +140,11 @@ function run( config.reporters = options.reporters; } + if (options.coverageReporters) { + // In Jest coverageReporters is an array of strings + config.coverageReporters = [options.coverageReporters]; + } + return from(runCLI(config, [options.jestConfig])).pipe( map(results => { return {