• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-fuego / fuego / 13087196340
75%

Build:
DEFAULT BRANCH: main
Ran 01 Feb 2025 09:12AM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Feb 2025 09:11AM UTC coverage: 91.41% (-2.2%) from 93.628%
13087196340

push

github

web-flow
Add framework-agnostic `MockContext` for testing (#351)

* feat: add framework-agnostic mock context for testing

Implements a MockContext[B] type that allows testing controllers without
framework dependencies. Includes comprehensive tests and documentation.

* feat(test): add framework-agnostic mock context

Add MockContext[B] to help users test their controllers without framework
dependencies. Includes realistic examples and documentation.

- Move testing docs from README.md to TESTING.md
- Add mock context with getters/setters
- Add example user controller tests
- Use fuego_test package for end-user perspective

Closes #349

* feat(test): add realistic mock context example

Replace basic getter/setter tests with a real-world example:
- Add UserController with Create and GetByID endpoints
- Add UserService with mock implementation
- Show proper separation of concerns
- Demonstrate practical testing patterns
- Move testing docs from README.md to TESTING.md

This provides users with a clear example of how to test their
controllers using the mock context in a real-world scenario.

Closes #349

* Resolved the review comments

* Removed the TESTING.md file

* Documentation and testing updates

* Use internal.CommonContext to provide most functions in MockContext

* refactor(mock): make MockContext fields public and leverage CommonContext functionality

* feat(testing): Expose MockContext fields for simpler test setup

Convert private fields to public and update docs with examples

* fix(mock): Initialize OpenAPIParams in MockContext constructor

Properly initialize CommonContext fields to prevent potential panics

* Removed unused import

* feat(mock): Add helper methods for setting query params with OpenAPI validation

* Removed unused comment

* Linting

* Adds `NewMockContextNoBody` to create a new MockContext suitable for a request & controller with no body

Changed WithXxx to SetXxx for query parameters.
Removed the ...option pattern for declaring q... (continued)

42 of 108 new or added lines in 1 file covered. (38.89%)

2437 of 2666 relevant lines covered (91.41%)

1.04 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
66
38.89
mock_context.go
Jobs
ID Job ID Ran Files Coverage
1 13087196340.1 01 Feb 2025 09:12AM UTC 31
91.41
GitHub Action Run
Source Files on build 13087196340
  • Tree
  • List 31
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b2965ee0 on github
  • Prev Build on main (#13076876034)
  • Next Build on main (#13109819616)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc