mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2026-11-01 13:12:19 +01:00
feat: add new assertions test type
This commit is contained in:
parent
6c4c1bace6
commit
17d08b9975
10 changed files with 603 additions and 16 deletions
|
|
@ -5,25 +5,35 @@ import "time"
|
|||
type TestType string
|
||||
|
||||
const (
|
||||
TestTypeScript TestType = "script"
|
||||
TestTypeUnit TestType = "unit"
|
||||
TestTypeSnapshot TestType = "snapshot"
|
||||
TestTypeScript TestType = "script"
|
||||
TestTypeUnit TestType = "unit"
|
||||
TestTypeSnapshot TestType = "snapshot"
|
||||
TestTypeAssertions TestType = "assertions"
|
||||
)
|
||||
|
||||
type AssertionResult struct {
|
||||
Ok bool `json:"ok"`
|
||||
Error bool `json:"error,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Expected string `json:"expected,omitempty"`
|
||||
Actual string `json:"actual,omitempty"`
|
||||
}
|
||||
|
||||
type SuiteSpec struct {
|
||||
Name string `json:"name"`
|
||||
Tests []TestSpec `json:"tests"`
|
||||
}
|
||||
|
||||
type TestSpec struct {
|
||||
Type TestType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Expected any `json:"expected,omitempty"`
|
||||
Actual any `json:"actual,omitempty"`
|
||||
ActualDrv string `json:"actualDrv,omitempty"`
|
||||
Script string `json:"script,omitempty"`
|
||||
Pos string `json:"pos,omitempty"`
|
||||
Type TestType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Expected any `json:"expected,omitempty"`
|
||||
Actual any `json:"actual,omitempty"`
|
||||
ActualDrv string `json:"actualDrv,omitempty"`
|
||||
Script string `json:"script,omitempty"`
|
||||
Assertions map[string]AssertionResult `json:"assertions,omitempty"`
|
||||
Pos string `json:"pos,omitempty"`
|
||||
|
||||
Suite string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue