Skip to content

Commit

Permalink
Replace script with e2e scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Mar 26, 2024
1 parent f4f0b4e commit 6011166
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 50 deletions.
3 changes: 3 additions & 0 deletions e2e/fixture-projects/script/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
solidity: "0.8.20"
}
3 changes: 3 additions & 0 deletions e2e/fixture-projects/script/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "script"
}
9 changes: 9 additions & 0 deletions e2e/fixture-projects/script/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const assert = require("assert")

async function main() {
const blockNumber = await hre.network.provider.send("eth_blockNumber")
assert.equal(blockNumber, "0x0")
}

main()
.catch(console.error)
12 changes: 12 additions & 0 deletions e2e/fixture-projects/script/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/env sh

# fail if any commands fails
set -e

# import helpers functions
. ../helpers.sh

echo "Running tests: $(basename "$(pwd)")"

echo "it should run a script that uses the hardhat network provider"
run_test_and_handle_failure "npx hardhat run script.js" 0
50 changes: 0 additions & 50 deletions packages/hardhat-core/scripts/issue-339.js

This file was deleted.

0 comments on commit 6011166

Please sign in to comment.