wishthis/node_modules/minimist/test/stop_early.js

18 lines
312 B
JavaScript
Raw Normal View History

2023-03-12 09:52:00 +00:00
'use strict';
2022-01-21 08:28:41 +00:00
var parse = require('../');
var test = require('tape');
test('stops parsing on the first non-option when stopEarly is set', function (t) {
2023-03-12 09:52:00 +00:00
var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
stopEarly: true,
});
2022-01-21 08:28:41 +00:00
2023-03-12 09:52:00 +00:00
t.deepEqual(argv, {
aaa: 'bbb',
_: ['ccc', '--ddd'],
});
2022-01-21 08:28:41 +00:00
2023-03-12 09:52:00 +00:00
t.end();
2022-01-21 08:28:41 +00:00
});