This repository was archived by the owner on Jan 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 22
33import { Command as Base } from '@oclif/command'
44export { flags } from '@oclif/command'
5- import { CLIError as OCLIFError } from '@oclif/errors'
5+ import { CLIError as OCLIFError } from '@oclif/errors'
66import { CLIError } from './clierror'
77export { CLIError } from './clierror'
88import ReadPipedData from './readpipeddata'
Original file line number Diff line number Diff line change 11import { Command } from '../src/command'
22import { CLIError } from './../src/clierror'
3+ import { CLIError as OCLIFError } from '@oclif/errors'
34import { expect , fancy } from 'fancy-test'
45import ReadPipedStdin from '../src/readpipeddata'
56import * as path from 'path' ;
@@ -36,6 +37,20 @@ describe('command', () => {
3637 . do ( output => expect ( output . stderr ) . to . equal ( 'failure\n' ) )
3738 . it ( 'Exits with error' )
3839
40+ fancy
41+ . stderr ( )
42+ . do ( async ( ) => {
43+ class Test extends Command {
44+ async run ( ) {
45+ throw new OCLIFError ( 'failure' )
46+ }
47+ }
48+
49+ return Test . run ( [ ] )
50+ } )
51+ . do ( output => expect ( output . stderr ) . to . equal ( 'failure\n' ) )
52+ . it ( 'Handles OCLIF Errors' )
53+
3954 fancy
4055 . stderr ( )
4156 . do ( async ( ) => {
You can’t perform that action at this time.
0 commit comments