keystonejs / keystone

The superpowered headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
9.18k stars 1.15k forks source link

Increase verbosity of `omit` tests #9055

Closed dcousens closed 7 months ago

dcousens commented 7 months ago

When modifying code near to the omit functionality, I quickly found myself wanting amount of detail as to when and where the tests were failing.

Unlike tape and other testing suites, jest only really offers you insight into your tests from the test(description, () => ..., which you often might group a number of expects statements within. This isn't helpful when the tests are verifying a number of expectations at the same time.

This pull request changes that so we many tests, with 1 expectation each. This pattern is actually a huge performance win too, and I'll be using in my next pull request for hooks.

codesandbox-ci[bot] commented 7 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 91ef98cdc13c3962c5062dae7732a47937b9ba15:

Sandbox Source
@keystone-6/sandbox Configuration