Skip to content

Commit

Permalink
Merge pull request #1 from ProjectOpenSea/ben/AddTests
Browse files Browse the repository at this point in the history
Add Tstorish tests
  • Loading branch information
0age authored Mar 27, 2024
2 parents 8050091 + f4f6701 commit d701775
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test CI

on:
push:
branches: [main]
tags: ["*"]
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
forge:
name: Run Forge Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install forge dependencies
run: forge install

- name: Run tests
run: FOUNDRY_PROFILE=test forge test -vvv
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
cache/
out/

#foundry test compilation files
cache
out
test-cache

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
Expand All @@ -13,4 +18,4 @@ docs/
# Dotenv file
.env

.DS_Store
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
8 changes: 8 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ src = "src"
out = "out"
libs = ["lib"]
evm_version = "cancun"
test = 'test/foundry'
remappings = [
'forge-std/=lib/forge-std/src/',
]

[profile.test]
src = 'test/foundry'
cache_path='test-cache'

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at bb4cee
23 changes: 23 additions & 0 deletions test/foundry/TestTstorish.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";

import {Tstorish} from "../../src/Tstorish.sol";

contract TestTstorish is Test {
Tstorish tstorish;

function setUp() public {
_deployTstorish();
}

function _deployTstorish() private {
tstorish = new Tstorish();
}

function testActivateTstore() public {
vm.expectRevert(abi.encodeWithSignature("TStoreAlreadyActivated()"));
tstorish.__activateTstore();
}
}

0 comments on commit d701775

Please sign in to comment.