Skip to content

Commit

Permalink
feat: Use tevm scripting in vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
William Cory authored and William Cory committed May 24, 2024
1 parent d24dda1 commit de0b4ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "vitest",
"dev": "npx vite ."
},
"keywords": [],
Expand Down
12 changes: 12 additions & 0 deletions src/counter.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createMemoryClient } from "tevm";
import { Counter } from "../contracts/Counter.s.sol";
import { test, expect } from "vitest";

test("scripting", () => {
// let's just throw on fail since we are just playing with scripts not building a production app
const memoryClient = createMemoryClient();

const scriptResult = memoryClient.tevmScript(Counter.read.count());

expect(scriptResult).toMatchInlineSnapshot(`Promise {}`);
});

0 comments on commit de0b4ac

Please sign in to comment.