go-testing

Write unit and integration tests for Go FHIR libraries.

2|Updated Feb 14, 2025
One-click install
npx skills add https://github.com/gofhir/validator --skill go-testing-gofhir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/gofhir/validator/tree/main/.claude/skills/go-testing
Command: npx skills add https://github.com/gofhir/validator --skill go-testing-gofhir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for writing effective unit and integration tests in Go, specifically tailored for the gofhir ecosystem.

Core Features & Use Cases

  • Unit Testing: Learn to test individual functions and components with clear examples.
  • Integration Testing: Understand how to test the interaction between different parts of the system.
  • FHIRPath and Validator Testing: Specific examples for testing FHIRPath expressions and the FHIR validator.
  • Mocking Services: Guidance on mocking external dependencies like Terminology Services.

Quick Start

Use the go-testing skill to write unit tests for a Go function that validates FHIR resources.

Frequently Asked Questions about go-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for FHIR resource validation in Go?

To write unit tests for FHIR resource validation in Go, use standard Go testing frameworks to create test fixtures and assert validation outcomes. This skill provides practical examples for testing individual FHIR validation functions and components.

What is the best way to test FHIRPath expressions in Go applications?

Testing FHIRPath expressions in Go involves executing the expressions against sample resources and asserting the expected evaluation results. This skill offers specific examples and best practices for validating FHIRPath logic within your applications.

How do I mock external Terminology Services for Go integration tests?

You can mock external Terminology Services for Go integration tests by creating mock implementations for dependency injection. This allows you to test component interactions without relying on live external services.

Does this guide cover setting up test fixtures for the gofhir ecosystem?

Yes, this guide covers setting up test fixtures specifically tailored for the gofhir ecosystem. It provides best practices for managing test data and fixtures for both unit and integration testing scenarios.

How do I structure integration tests for Go applications interacting with FHIR libraries?

Structuring integration tests for Go applications interacting with FHIR libraries involves testing the interaction between different system parts. This skill guides you through testing these interactions using practical examples and mocking.