-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 17191/onboarding-unit-tests
- Loading branch information
Showing
25 changed files
with
379 additions
and
70 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,66 @@ | ||
# Getting Started | ||
|
||
## Running a Jest test | ||
|
||
```bash | ||
> yarn jest <path> | ||
``` | ||
|
||
## Debugging | ||
|
||
### Debugging Jest in VS Code | ||
|
||
1. Open **VS Code** | ||
2. Open the “Run and Debug” panel (⇧⌘D) | ||
3. Click the “JavaScript Debug Terminal” button to open the Terminal | ||
4. Run Jest using Node | ||
|
||
```bash | ||
> yarn jest --watch <path> | ||
``` | ||
|
||
Additional methods and information to debug in VS Code can be found [here](https://jestjs.io/docs/troubleshooting#debugging-in-vs-code) | ||
|
||
### Debugging Jest on Chrome DevTools | ||
|
||
1. Run Jest using Node with the V8 Inspector | ||
|
||
```bash | ||
> node --inspect ./node_modules/.bin/jest --watch -i <path> | ||
or | ||
> node --inspect ./node_modules/.bin/jest <path> | ||
``` | ||
|
||
**Options:** | ||
|
||
```jsx | ||
node: | ||
--inspect=[host:]port | ||
Activate inspector on host:port. Default is 127.0.0.1:9229. | ||
V8 Inspector integration allows attaching Chrome DevTools and IDEs | ||
to Node.js instances for debugging and profiling. It uses the | ||
Chrome DevTools Protocol. | ||
jest: | ||
--watch Watch files for changes and rerun tests | ||
related to changed files. If you want to | ||
re-run all tests when a file has changed, | ||
use the `--watchAll` option. [boolean] | ||
-i, --runInBand Run all tests serially in the current | ||
process (rather than creating a worker pool | ||
of child processes that run tests). This is | ||
sometimes useful for debugging, but such use | ||
cases are pretty rare. [boolean] | ||
``` | ||
|
||
|
||
1. Open Chrome DevTools for Node | ||
1. Open a **Chromium** browser | ||
2. Go to [chrome://inspect/#devices](chrome://inspect/#devices) | ||
3. Click “Open dedicated DevTools for Node” link |
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 @@ | ||
///: BEGIN:ONLY_INCLUDE_IN(flask) | ||
type SnapsMetadata = { | ||
[snapId: string]: { | ||
name: string; | ||
}; | ||
}; | ||
|
||
// If a Snap ID is present in this object, its metadata is used before the info | ||
// of the snap is fetched. Ideally this information would be fetched from the | ||
// snap registry, but this is a temporary solution. | ||
export const SNAPS_METADATA: SnapsMetadata = { | ||
'npm:@metamask/test-snap-error': { | ||
name: 'Error Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-confirm': { | ||
name: 'Confirm Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-dialog': { | ||
name: 'Dialog Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-bip44': { | ||
name: 'BIP-44 Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-managestate': { | ||
name: 'Manage State Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-notification': { | ||
name: 'Notification Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-bip32': { | ||
name: 'BIP-32 Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-insights': { | ||
name: 'Insights Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-rpc': { | ||
name: 'RPC Test Snap', | ||
}, | ||
'npm:@metamask/test-snap-cronjob': { | ||
name: 'Cronjob Test Snap', | ||
}, | ||
}; | ||
///: END:ONLY_INCLUDE_IN |
Oops, something went wrong.