Skip to content

Commit

Permalink
Cairo1 events (#380)
Browse files Browse the repository at this point in the history
* [skip testnet]
  • Loading branch information
notV4l committed Jun 20, 2023
1 parent afc83b3 commit f62049b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/general-tests/declare-v2-test/check.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hardhatStarknetCompile, hardhatStarknetTest } from "../../utils/cli-functions";

hardhatStarknetCompile(["cairo1-contracts/contract1.cairo", "--add-pythonic-hints"]);
hardhatStarknetTest(["--no-compile test/declare-v2.test.ts"]);
hardhatStarknetTest(["--no-compile test/cairo1/declare-v2.test.ts"]);
4 changes: 4 additions & 0 deletions test/general-tests/decode-event-v2-test/check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { hardhatStarknetCompile, hardhatStarknetTest } from "../../utils/cli-functions";

hardhatStarknetCompile(["cairo1-contracts/events.cairo", "--add-pythonic-hints"]);
hardhatStarknetTest(["--no-compile test/cairo1/decode-events.test.ts"]);
12 changes: 12 additions & 0 deletions test/general-tests/decode-event-v2-test/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import "@shardlabs/starknet-hardhat-plugin";

module.exports = {
starknet: {
network: process.env.NETWORK
},
networks: {
devnet: {
url: "http://127.0.0.1:5050"
}
}
};
4 changes: 4 additions & 0 deletions test/general-tests/decode-event-v2-test/network.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "../../network.schema",
"devnet": true
}
11 changes: 11 additions & 0 deletions www/docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ To run a specific test case in the test group you can pass in the name of direct
$ npm run test-general-tests -- declare-test
```

### Executing individual tests with dockerized environnement

If you only use dockerized environnement you don't need to install dependencies locally.
Therefore you can run `declare-test` test case in `general-tests` test group from `starknet-hardhat-example` directory like this :

```sh
$ npx ts-node STARKNET_HARDHAT_PLUGIN_PATH/test/general-tests/declare-test/check.ts
```

Using this command will use the starknet-hardhat-example hardhat.config.ts. You can make modifications to make it match the config file in the test directory `STARKNET_HARDHAT_PLUGIN_PATH/test/general-tests/declare-test/hardhat.config.ts`

### Running tests in dev mode

To run tests locally with test-dev. This is designed to run same tests repeatedly while developing.
Expand Down

0 comments on commit f62049b

Please sign in to comment.