deployphp/node_modules/minimist/test/stop_early.js

18 lines
312 B
JavaScript
Raw Permalink Normal View History

2023-03-28 15:15:22 +00:00
'use strict';
2023-01-10 15:49: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-28 15:15:22 +00:00
var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
stopEarly: true,
});
2023-01-10 15:49:41 +00:00
2023-03-28 15:15:22 +00:00
t.deepEqual(argv, {
aaa: 'bbb',
_: ['ccc', '--ddd'],
});
2023-01-10 15:49:41 +00:00
2023-03-28 15:15:22 +00:00
t.end();
2023-01-10 15:49:41 +00:00
});