-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ added vitest arg passthrough (#451)
* feat: ✨ added vitest arg passthrough * feat: ✨ Added vitest arg passthrough to moonwall config * style: 💄 lint
- Loading branch information
1 parent
543bda2
commit 7cce71c
Showing
11 changed files
with
167 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@moonwall/cli": patch | ||
"@moonwall/tests": patch | ||
--- | ||
|
||
Added vitest arg pass through |
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,30 @@ | ||
--- | ||
"@moonwall/cli": patch | ||
--- | ||
|
||
### Enhanced Test CLI Options | ||
|
||
#### New Features | ||
|
||
- Added support for passing Vitest configuration options directly through CLI | ||
|
||
```bash | ||
moonwall test dev_test --vitest "bail=2 retry=2" | ||
``` | ||
|
||
This can also be added to your `moonwall.config.json` file like: | ||
|
||
```json | ||
{ | ||
"name": "passthrough_test", | ||
"testFileDir": ["suites/multi_fail"], | ||
"description": "Testing that bail can be passed through", | ||
"foundation": { | ||
"type": "read_only" | ||
}, | ||
"vitestArgs": { | ||
"bail": 1 | ||
}, | ||
"connections": [] | ||
} | ||
``` |
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 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 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 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 |
---|---|---|
|
@@ -66,6 +66,7 @@ | |
"ethers": "*", | ||
"polkadot-api": "*", | ||
"viem": "*", | ||
"vitest": "*", | ||
"web3": "*" | ||
}, | ||
"publishConfig": { | ||
|
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 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,57 @@ | ||
import { expect, describeSuite, beforeAll } from "@moonwall/cli"; | ||
import { setupLogger } from "@moonwall/util"; | ||
import { setTimeout } from "timers/promises"; | ||
describeSuite({ | ||
id: "F01", | ||
title: "This test suite fails multiple times", | ||
foundationMethods: "read_only", | ||
testCases: ({ it, log }) => { | ||
const anotherLogger = setupLogger("additional"); | ||
|
||
beforeAll(() => { | ||
log("Test suite setup"); | ||
}); | ||
|
||
it({ | ||
id: "T01", | ||
title: "This is a bool test case", | ||
test: async() => { | ||
await setTimeout(500) | ||
expect(false).to.be.true; | ||
}, | ||
}); | ||
it({ | ||
id: "T02", | ||
title: "This is a bool test case", | ||
test: async() => { | ||
const rand = Math.floor(Math.random() * 1000); | ||
expect(rand).toBeGreaterThan(800) | ||
}, | ||
}); | ||
it({ | ||
id: "T03", | ||
title: "This is a bool test case", | ||
test: async() => { | ||
await setTimeout(500) | ||
expect(false).to.be.true; | ||
}, | ||
}); | ||
it({ | ||
id: "T04", | ||
title: "This is a bool test case", | ||
test: async() => { | ||
await setTimeout(500) | ||
expect(false).to.be.true; | ||
}, | ||
}); | ||
it({ | ||
id: "T05", | ||
title: "This is a bool test case", | ||
test: async() => { | ||
await setTimeout(500) | ||
expect(false).to.be.true; | ||
}, | ||
}); | ||
|
||
}, | ||
}); |