-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add custom responses for cache misses while network access is disabled - Add custom responses for unmocked requests while network access is disabled - Add `--reset`/`-r` reset flag to restart jambox --------- Co-authored-by: Arthur Buldauskas <[email protected]>
- Loading branch information
Showing
15 changed files
with
287 additions
and
65 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
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,43 @@ | ||
# Snapshot report for `src/__tests__/parse-args.test.mjs` | ||
|
||
The actual snapshot is saved in `parse-args.test.mjs.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## arg parsing, jambox flags: no | ||
|
||
> Snapshot 1 | ||
{ | ||
target: [ | ||
'yarn', | ||
'dev', | ||
], | ||
} | ||
|
||
## arg parsing, jambox flags: yes | ||
|
||
> Snapshot 1 | ||
{ | ||
reset: true, | ||
target: [ | ||
'yarn', | ||
'dev', | ||
], | ||
} | ||
|
||
## arg parsing, custom flags | ||
|
||
> Snapshot 1 | ||
{ | ||
port: 99, | ||
reset: true, | ||
target: [ | ||
'yarn', | ||
'dev', | ||
'--port', | ||
'9000', | ||
], | ||
} |
Binary file not shown.
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,37 @@ | ||
import test from 'ava'; | ||
import { parseArgs, JAMBOX_FLAGS } from '../parse-args.mjs'; | ||
|
||
test('arg parsing, jambox flags: no', (t) => { | ||
const flags = parseArgs(['yarn', 'dev'], JAMBOX_FLAGS); | ||
t.snapshot(flags); | ||
}); | ||
|
||
test('arg parsing, jambox flags: yes', (t) => { | ||
const flags = parseArgs(['-r', 'yarn', 'dev'], JAMBOX_FLAGS); | ||
t.snapshot(flags); | ||
}); | ||
|
||
test('arg parsing, custom flags', (t) => { | ||
const flags = parseArgs( | ||
[ | ||
'--port', | ||
'0', | ||
'-p', | ||
'99', | ||
'-r', | ||
'--reset', | ||
'yarn', | ||
'dev', | ||
'--port', | ||
'9000', | ||
], | ||
{ | ||
...JAMBOX_FLAGS, | ||
'--port': ['port', 1, String], | ||
// shouldn't do it this way but it's allowed to change the types here | ||
'-p': ['port', 1, Number], | ||
} | ||
); | ||
|
||
t.snapshot(flags); | ||
}); |
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
Oops, something went wrong.