Skip to content

Commit

Permalink
Update instructions to run individual test. Close #263.
Browse files Browse the repository at this point in the history
  • Loading branch information
msinkec committed Jan 31, 2024
1 parent 9ac9461 commit 24c1a05
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ npm install
In order to run smart contract tests locally, just simply run:

```sh
npm test
npm t
```

This will run every test defined under `tests/local/`.

To run tests for a specific smart contract, i.e. the `Counter` smart contract, run the following:
To run tests only for a specific smart contract, i.e. the `Counter` smart contract, you can run the following:

```sh
npm run build && npx mocha 'dist/tests/local/counter.test.js'
npx scrypt-cli@latest compile -i "src/contracts/counter.ts" && \
NETWORK="local" npx mocha --no-config --require ts-node/register tests/counter.test.ts
```

To understand how these tests work, please read the [sCrypt docs](https://scrypt.io/docs/how-to-test-a-contract).
You can also manually adjust paths under `tsconfig-scryptTS.json` (contract to compile) and `.mocharc.json` (test files to run) and simply run `npm t`.

To understand how the tests work, please read the [sCrypt docs](https://scrypt.io/docs/how-to-test-a-contract).

## Test on the Bitcoin Testnet

Expand Down

0 comments on commit 24c1a05

Please sign in to comment.