-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add option to print errors Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com> * added debug test Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
- Loading branch information
1 parent
5a43408
commit 6b2e017
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
const test = require('tap').test | ||
const Autocannon = require('../autocannon') | ||
|
||
test('debug works', (t) => { | ||
t.plan(5) | ||
|
||
var args = Autocannon.parseArguments([ | ||
'-H', 'X-Http-Method-Override=GET', | ||
'-m', 'POST', | ||
'-b', 'the body', | ||
'--debug', | ||
'http://localhost/foo/bar' | ||
]) | ||
|
||
t.equal(args.url, 'http://localhost/foo/bar') | ||
t.strictSame(args.headers, { 'X-Http-Method-Override': 'GET' }) | ||
t.equal(args.method, 'POST') | ||
t.equal(args.body, 'the body') | ||
t.equal(args.debug, true) | ||
}) |