fix(milestone): make sure code snippet compiles and some formatting (#73)
This commit is contained in:
parent
b111ea271a
commit
65b33d962e
|
@ -278,7 +278,7 @@ Time to test our code! Head over into the `tests` folder in the root directory.
|
||||||
```typescript
|
```typescript
|
||||||
it('setup game!', async() => {
|
it('setup game!', async() => {
|
||||||
const gameKeypair = anchor.web3.Keypair.generate();
|
const gameKeypair = anchor.web3.Keypair.generate();
|
||||||
const playerOne = program.provider.wallet;
|
const playerOne = (program.provider as anchor.AnchorProvider).wallet;
|
||||||
const playerTwo = anchor.web3.Keypair.generate();
|
const playerTwo = anchor.web3.Keypair.generate();
|
||||||
await program.methods
|
await program.methods
|
||||||
.setupGame(playerTwo.publicKey)
|
.setupGame(playerTwo.publicKey)
|
||||||
|
|
|
@ -212,20 +212,16 @@ of all workspace programs before running them.
|
||||||
If the configured network is a localnet, then automatically starts the localnetwork and runs
|
If the configured network is a localnet, then automatically starts the localnetwork and runs
|
||||||
the test.
|
the test.
|
||||||
|
|
||||||
::: tip Note
|
> Note: Be sure to shutdown any other local validators, otherwise `anchor test` will fail to run.
|
||||||
Be sure to shutdown any other local validators, otherwise `anchor test` will fail to run.
|
>
|
||||||
|
> If you'd prefer to run the program against your local validator use `anchor test --skip-local-validator`.
|
||||||
If you'd prefer to run the program against your local validator use `anchor test --skip-local-validator`.
|
|
||||||
:::
|
|
||||||
|
|
||||||
When running tests we stream program logs to `.anchor/program-logs/<address>.<program-name>.log`
|
When running tests we stream program logs to `.anchor/program-logs/<address>.<program-name>.log`
|
||||||
|
|
||||||
::: tip Note
|
> Note: The Anchor workflow [recommends](https://www.parity.io/paritys-checklist-for-secure-smart-contract-development/)
|
||||||
The Anchor workflow [recommends](https://www.parity.io/paritys-checklist-for-secure-smart-contract-development/)
|
> to test your program using integration tests in a language other
|
||||||
to test your program using integration tests in a language other
|
> than Rust to make sure that bugs related to syntax misunderstandings
|
||||||
than Rust to make sure that bugs related to syntax misunderstandings
|
> are coverable with tests and not just replicated in tests.
|
||||||
are coverable with tests and not just replicated in tests.
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Upgrade
|
## Upgrade
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue