Skip to content

Commit 69851a7

Browse files
tusbarphated
authored andcommitted
Update: Add failing test for flag values being dropped
1 parent 550d22a commit 69851a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const reorder = require('../lib/reorder');
55
const flaggedRespawn = require('../');
66

77
describe('flaggedRespawn', function () {
8-
var flags = ['--harmony', '--use_strict']
8+
var flags = ['--harmony', '--use_strict', '--stack_size']
99

1010
describe('reorder', function () {
1111

@@ -18,6 +18,12 @@ describe('flaggedRespawn', function () {
1818
.to.deep.equal(noRespawnNeeded);
1919
});
2020

21+
it('should keep flags values when not placed first', function () {
22+
var args = ['node', 'file.js', '--stack_size=2048'];
23+
var expected = ['node', '--stack_size=2048', 'file.js'];
24+
expect(reorder(flags, args)).to.deep.equal(expected);
25+
});
26+
2127
it('should ignore special flags when they are in the correct position', function () {
2228
var args = ['node', '--harmony', 'file.js', '--flag'];
2329
expect(reorder(flags, reorder(flags, args))).to.deep.equal(args);

0 commit comments

Comments
 (0)