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

Document how to add tests in contributing docs #164

Open
spenserblack opened this issue Jul 5, 2023 · 0 comments
Open

Document how to add tests in contributing docs #164

spenserblack opened this issue Jul 5, 2023 · 0 comments
Assignees
Labels
chore A task to perform

Comments

@spenserblack
Copy link
Owner

spenserblack commented Jul 5, 2023

This way, even if a user isn't able to fix an issue, they can still contribute.

Perhaps feedback.test.ts for community-driven tests. Feedback should probably be manually written, so no snapshot tests. Maybe something like this:

// feedback.test.ts
// NOTE Setting issueTitle to a number is a shortcut to making the title "Issue #123"
type FeedbackTest = [issueTitle: number | string, input: string, expected: string];

const feedback: FeedbackTest[] = [];

// NOTE If you're just contributing a test, you don't need to read past this line
const tests: [title: string, input: string, expected: string][] = feedback.map(([title, ...test]) => [typeof title === "number" ? `Issue #${title}` : title, ...test]);
test.each(tests)("%s", (_title, input, expected) => {
  expect(parse(input)).toBe(expected);
});
@spenserblack spenserblack self-assigned this Jul 5, 2023
@spenserblack spenserblack added the chore A task to perform label Nov 14, 2024
@spenserblack spenserblack changed the title Document how to add tests to in contributing docs Document how to add tests in contributing docs Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task to perform
Projects
None yet
Development

No branches or pull requests

1 participant