Skip to content
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

Replace assert rejects and doesNotReject with chai assertions on status code and verification results #126

Open
aljones15 opened this issue Oct 2, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@aljones15
Copy link
Contributor

Related: #4

Existing assertions can be re-used to assert on status codes:

https://github.com/w3c-ccg/data-integrity-test-suite-assertion/blob/52bd29227a99a45d79bf437437d0ea379e4a0e46/assertions.js#L25-L56

https://github.com/w3c-ccg/data-integrity-test-suite-assertion/blob/52bd29227a99a45d79bf437437d0ea379e4a0e46/assertions.js#L244-L280

If possible re-use these common issuance and failure assertions.

@aljones15 aljones15 added the enhancement New feature or request label Oct 2, 2024
@aljones15
Copy link
Contributor Author

aljones15 commented Oct 16, 2024

please note that the current use of assert.rejects and assert.doesNotReject causes issues when a test fails do to an internal reason such as test data is missing or an implementation is missing an endpoint needed for a test. We should be at a minimum asserting on an HTTP status code 400 for negative tests. Checking for a status code at least avoids cases where a promise throws for a reason not related to the test at hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants