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

Allow tests to be skipped #12

Closed
lloydk opened this issue Feb 13, 2024 · 10 comments
Closed

Allow tests to be skipped #12

lloydk opened this issue Feb 13, 2024 · 10 comments

Comments

@lloydk
Copy link
Contributor

lloydk commented Feb 13, 2024

As mentioned in color-js/color.js#428 it would be nice if tests could be skipped.

This could be as simple as adding a skip property to a test or set of tests. E.g.

{
	name: "hwb()",
	skip: "hwb color space not implemented yet",
	tests: [
		{
			args: "hwb(180 20% 30%)",
			expect: '{"spaceId":"hwb","coords":[180,20,30],"alpha":1}'
		},
	]
}

The test runners would output the number of skipped tests.

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 4, 2024

Hey @lloydk, I’ve started working on this and I had a question: how did you envision the value of skip to be used? I thought it would just print something like "1/6 skipped".

@lloydk
Copy link
Contributor Author

lloydk commented Mar 4, 2024

Hey @lloydk, I’ve started working on this and I had a question: how did you envision the value of skip to be used? I thought it would just print something like "1/6 skipped".

That's exactly what I was thinking.

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 5, 2024

Ok, I pushed an experimental implementation, would love it if you could try it and give me feedback! (hasn't published to npm yet though)

@lloydk
Copy link
Contributor Author

lloydk commented Mar 5, 2024

It would be nice if the skip property was inherited so I could easily skip a group of tests. Or be able to set it at the top level of a test file and then set a specific test to skip: false to have only a single test run (useful for debugging).

I would use yellow instead of dim for the output but that's just my personal preference.

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 5, 2024

It was meant to be inherited! If it's not, that's a bug!

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 5, 2024

Have you tried it and it does not inherit?

@lloydk
Copy link
Contributor Author

lloydk commented Mar 5, 2024

Have you tried it and it does not inherit?

I tried it and it didn't work

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 5, 2024

Ah bummer. Can you open an issue about that bug?

@lloydk
Copy link
Contributor Author

lloydk commented Mar 5, 2024

Ah bummer. Can you open an issue about that bug?

Created a PR #15, it was a simple fix.

@LeaVerou
Copy link
Owner

LeaVerou commented Mar 6, 2024

Ah bummer. Can you open an issue about that bug?

Created a PR #15, it was a simple fix.

You rock man! Thanks so much.

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

No branches or pull requests

2 participants