@@ -8,6 +8,7 @@ import * as path from 'path';
88import { assert , expect , config } from 'chai' ;
99import * as sinon from 'sinon' ;
1010import { DeployResult } from '@salesforce/source-deploy-retrieve' ;
11+ import { ux } from '@oclif/core' ;
1112import { getCoverageFormattersOptions } from '../../src/utils/coverage' ;
1213import { DeployResultFormatter } from '../../src/formatters/deployResultFormatter' ;
1314import { getDeployResult } from './deployResponses' ;
@@ -21,6 +22,29 @@ describe('deployResultFormatter', () => {
2122 sandbox . restore ( ) ;
2223 } ) ;
2324
25+ describe ( 'displayFailures' , ( ) => {
26+ const deployResultFailure = getDeployResult ( 'failed' ) ;
27+ const tableStub = sandbox . stub ( ux , 'table' ) ;
28+
29+ it ( 'prints file responses, and messages from server' , ( ) => {
30+ const formatter = new DeployResultFormatter ( deployResultFailure , { verbose : true } ) ;
31+ formatter . display ( ) ;
32+ expect ( tableStub . callCount ) . to . equal ( 1 ) ;
33+ expect ( tableStub . firstCall . args [ 0 ] ) . to . deep . equal ( [
34+ {
35+ error : 'This component has some problems' ,
36+ fullName : 'ProductController' ,
37+ problemType : 'Error' ,
38+ } ,
39+ {
40+ error : 'This component has some problems' ,
41+ fullName : 'ProductController' ,
42+ problemType : 'Error' ,
43+ } ,
44+ ] ) ;
45+ } ) ;
46+ } ) ;
47+
2448 describe ( 'coverage functions' , ( ) => {
2549 describe ( 'getCoverageFormattersOptions' , ( ) => {
2650 it ( 'clover, json' , ( ) => {
0 commit comments