-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace bash test to TS using shelljs (#251)
* [skip ci]
- Loading branch information
Showing
140 changed files
with
1,234 additions
and
866 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
16 changes: 0 additions & 16 deletions
16
test/configuration-tests/with-account-compilation-option/check.sh
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
test/configuration-tests/with-account-compilation-option/check.ts
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,16 @@ | ||
import { copyFileSync } from "fs"; | ||
import path from "path"; | ||
import { hardhatStarknetCompile } from "../../utils/cli-functions"; | ||
import { assertContains } from "../../utils/utils"; | ||
|
||
const contractName = "dummy_account.cairo"; | ||
const contractPath = path.join("contracts", contractName); | ||
|
||
const expected = "Use the --account-contract flag to compile an account contract."; | ||
|
||
console.log("Testing rejection of compilation without the account flag"); | ||
copyFileSync(path.join(__dirname, contractName), contractPath); | ||
const execution = hardhatStarknetCompile(contractPath.split(" "), true); | ||
assertContains(execution.stderr, expected); | ||
console.log("Success"); | ||
hardhatStarknetCompile(`${contractPath} --account-contract`.split(" ")); |
This file was deleted.
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,12 @@ | ||
import { hardhatStarknetCompile, hardhatStarknetDeploy } from "../../utils/cli-functions"; | ||
import { ensureEnvVar, rmrfSync } from "../../utils/utils"; | ||
|
||
const network = ensureEnvVar("NETWORK"); | ||
|
||
hardhatStarknetCompile("contracts/contract.cairo".split(" ")); | ||
hardhatStarknetDeploy( | ||
`--starknet-network ${network} my-starknet-artifacts/contracts/contract.cairo/ --inputs 10`.split( | ||
" " | ||
) | ||
); | ||
rmrfSync("my-starknet-artifacts"); |
This file was deleted.
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,11 @@ | ||
import { hardhatStarknetCompile, hardhatStarknetDeploy } from "../../utils/cli-functions"; | ||
import { ensureEnvVar } from "../../utils/utils"; | ||
|
||
const network = ensureEnvVar("NETWORK"); | ||
|
||
hardhatStarknetCompile("contracts/contract.cairo".split(" ")); | ||
hardhatStarknetDeploy( | ||
`starknet-artifacts/contracts/contract.cairo --starknet-network ${network} --inputs 10`.split( | ||
" " | ||
) | ||
); |
This file was deleted.
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,9 @@ | ||
import { hardhatStarknetRun, hardhatStarknetTest } from "../../utils/cli-functions"; | ||
|
||
// Test how --starknet-network can be specified through CLI while at the same time | ||
// overriding hardhat.config specification. | ||
// It would be sufficient to run this test just once and not for both alpha and devnet. | ||
// Only tests if --starknet-network is accepted, not if the correct network is targeted. | ||
|
||
hardhatStarknetRun("--no-compile scripts/compile-contract.ts".split(" ")); | ||
hardhatStarknetTest("--no-compile --starknet-network devnet test/quick-test.ts".split(" ")); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.