Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Improve unit tests in discountsParser_test.go

Open Beginner friendly
#201 1 comment 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
testing-qa

Research direction

Open discountsParser_test.go and inspect TestParseDiscountItem, TestIsValidDiscount, TestCleanText, TestExtractEmail, and TestTrimAfter. Compare their table-driven structure with parser/requisiteParser_test.go, then run the relevant Go tests. Done means each named test uses a slice with the former key represented by a Name field and all tests still pass.

Written by the indexing model from the issue text.

Description

L1 recommended for recruits

TestParseDiscountItem, TestIsValidDiscount, TestCleanText, TestExtractEmail, and TestTrimAfter use the following format for table driven tests:

testCases := map[string]struct {
		html     string
		category string
		expected schema.DiscountProgram
	}{
		"complete_entry": { ... } 

Change them to represent their table as a slice (move key into a field Name).

A good example can be found [here](https://github.com/UTDNebula/api-tools/blob/develop/parser/requisiteParser_test.go)

Resources

https://pkg.go.dev/testing

Dominant language
Go
Stars
12
Forks
54
Avg merge
2m
Merged PRs (30d)
1

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UTDNebula/api-tools

All issues in UTDNebula/api-tools

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.