1.0.1 • Published 4 years ago
@fyxgaming/run v1.0.1
Run
Commands
npm run lint- Lint and automatically fix errorsnpm run build- Build outputsnpm run test- Test library quicklynpm run test:node- Test the minified node buildnpm run test:browser- Test the minified browser build (Chrome default)npm run test:cover- Collect code coveragenpm run deploy- Redeploy extras to the blockchainnpm run bump- Create a new patch releasenpm run test test/plugins/local-purse.js- Run just the purse tests
Configuring the tests
Various environment variables may be used to configure the tests:
| Name | Description | Possible Values | Default |
|---|---|---|---|
NETWORK | Network to test on | mock, main, test, stn | mock |
BROWSER | Browser used for testing | chrome, firefox, safari, MicrosoftEdge | chrome |
STRESS | Whether to run the stress tests | true, false | false |
PURSE_[network] | Purse key used on a specific network | your string privkey | undefined |
API | Blockchain API when not using the mock network | run, whatsonchain | undefined |
APIKEY_[api] | API key used with a specific blockchain API | your string api key | undefined |
LOGGER | Whether to log internal messages to the console | true, false | false |
Examples
env BROWSER=safari npm run test:browser- Test the browser build on Safarienv STRESS=1 npm run test- Test library with stress testsenv NETWORK=test env PURSE=<funded_private_key> npm run test- Run all tests on testnet
.env file
For ease of use, you may also store these variables in a .env file where the tests are run. Here's a sample:
BROWSER=safari
PURSE_MAIN=<your priate key>
PURSE_TEST=<your private key>
APIKEY_MATTERCLOUD=<your api key>