|
1 | 1 | /* global describe, it, beforeEach */ |
2 | 2 |
|
3 | | -var checkUsage = require('./helpers/utils').checkOutput |
4 | | -var chalk = require('chalk') |
5 | | -var path = require('path') |
6 | | -var yargs = require('../') |
7 | | -var rebase = require('../yargs').rebase |
| 3 | +const checkUsage = require('./helpers/utils').checkOutput |
| 4 | +const chalk = require('chalk') |
| 5 | +const path = require('path') |
| 6 | +const yargs = require('../') |
| 7 | +const rebase = require('../yargs').rebase |
| 8 | +const YError = require('../lib/yerror') |
8 | 9 |
|
9 | 10 | require('chai').should() |
10 | 11 |
|
@@ -482,7 +483,7 @@ describe('usage tests', function () { |
482 | 483 | describe: 'bar command' |
483 | 484 | } |
484 | 485 | }, function (argv) { |
485 | | - throw new Error('blah') |
| 486 | + throw new YError('blah') |
486 | 487 | }) |
487 | 488 | .fail(function (message, error, yargs) { |
488 | 489 | yargs.showHelp() |
@@ -534,14 +535,14 @@ describe('usage tests', function () { |
534 | 535 | }) |
535 | 536 | .exitProcess(false) |
536 | 537 | }, function (argv) { |
537 | | - throw new Error('foo') |
| 538 | + throw new YError('foo') |
538 | 539 | }) |
539 | 540 | .argv |
540 | 541 | } catch (error) { |
541 | 542 |
|
542 | 543 | } |
543 | 544 | }) |
544 | | - r.logs.should.deep.equal([['Error', 'foo'], 'is triggered last']) |
| 545 | + r.logs.should.deep.equal([['YError', 'foo'], 'is triggered last']) |
545 | 546 | r.should.have.property('exit').and.be.false |
546 | 547 | }) |
547 | 548 | }) |
|
0 commit comments