Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Add a hidden: true option #6

Open
emilymdubois opened this issue Jul 30, 2018 · 2 comments
Open

Add a hidden: true option #6

emilymdubois opened this issue Jul 30, 2018 · 2 comments

Comments

@emilymdubois
Copy link

This library enforces a paradigm that is reinforced the more it's used in a project: prop permutations go in test_cases files, and test files iterate through the test cases and make assertions.

However, there are certain components (e.g., higher-order components) that I may want to exclude from the test kitchen component without introducing a different testing structure paradigm. One idea would be to introduce a hidden: true option into the test case API that filters out that case from the final component.

@davidtheclark
Copy link
Contributor

@emilymdubois Ah, I realize I forgot to document this: the convention @danswick and I were trying out was to export a different object with test cases that you don't want to be displayed. Anything in testCases will be displayed — but you can export whatever else you want and import them into your test file. So you could export a unrederedTestCases object and use its contents in your unit tests, but React Test Kitchen won't try to render it. @danswick does that sound right?

@danswick
Copy link
Contributor

danswick commented Aug 1, 2018

Yes, that jives with how I remember it, @davidtheclark!

There's a superfulous noRenderCases export here from when we were discussing this.

And the build-index.js script that ultimately drives the demo page checks each item in the index, but only checks them for exported testCases and nothing else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants