-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate test implementation in validate-test #809
Conversation
🦋 Changeset detectedLatest commit: 6434917 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A preview package of this pull request has been published with the tag $ npm install @bigtest/suite@validate-test-object or by updating your package.json to: {
"@bigtest/suite": "validate-test-object"
} |
74446f8
to
8ffcba2
Compare
8ffcba2
to
cf2c980
Compare
69ea1c3
to
61294a8
Compare
packages/suite/src/validate-test.ts
Outdated
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function ensureIsTest (test: any, path: string[] = [], file?: string): test is Test { | ||
if(!test) { | ||
throw new TestValidationError("contains no description.\n\nDoes the test file contain a default export?", path, file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this error message should not mention description
?
packages/suite/src/validate-test.ts
Outdated
} | ||
|
||
if(!test?.children || !test?.assertions) { | ||
throw new TestValidationError('contains no assertions or children.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have these as separate, more specific errors?
The CI build should be fixed now, could you rebase this? |
9f93ac5
to
caa935a
Compare
rebased and gone! |
In response to #801 where a malformed test file resulted in a meaningless error message.
This PR verifies (in
validate-test
) that a test object must haveDescriptive errors are thrown if either of the above is not true.