#testing
26 snippets tagged with #testing
Native Test Runner and Assert
Write tests using Node.js built-in test runner and assert module — no external dependencies needed.
Best for: Unit testing without external packages
Dependency Injection Container
Build a lightweight DI container with singleton and transient scopes for testable Node.js applications.
Best for: Testable application architecture
Testing Server Components
Test Next.js server components and server actions using testing-library and mocks.
Best for: unit testing
Pytest Fixtures and Parametrize
Reusable pytest fixtures with scope control, parametrize for data-driven tests, and temporary resources.
Best for: Unit test setup
LLM Output Evaluation and Scoring
Evaluate LLM outputs programmatically with scoring rubrics for quality, relevance, and safety.
Best for: prompt testing
LLM Prompt Testing Framework
Write automated tests for LLM prompts using Python assertions to detect regressions.
Best for: prompt regression testing
LLM Testing with DeepEval
Write unit tests for LLM outputs using the DeepEval framework for correctness and hallucination detection.
Best for: LLM testing
GitHub Actions Test Matrix Strategy
GitHub Actions workflow with matrix strategy to test across multiple Node versions and OS platforms.
Best for: Cross-platform compatibility testing
GitHub Actions — Advanced Matrix Strategy
Complex matrix strategies with include/exclude, fail-fast control, and dynamic matrix generation.
Best for: Cross-platform and multi-version testing
Data Quality Testing with Expectations
Define and run data quality expectations for automated validation in data pipelines.
Best for: Automated data quality gates in pipelines
SQL Data Quality Checks and Assertions
Reusable SQL queries for data quality: null checks, uniqueness, referential integrity, and freshness.
Best for: Automated data quality gates in ETL pipelines
dbt Source Freshness and Testing
Configure dbt source freshness checks and schema tests to validate upstream data pipelines.
Best for: Ensuring upstream data sources are fresh
dbt Run and Test — CI/CD Pipeline Script
Bash script for running dbt build with testing, documentation generation, and failure notifications.
Best for: Automating dbt builds in CI/CD pipelines
Great Expectations Data Quality Suite
Define and run a Great Expectations validation suite to catch data quality issues early.
Best for: CI data validation
Generate Synthetic Data with Faker
Create realistic test datasets for development and testing using the Faker library.
Best for: test data generation
Property-Based Testing for Data Functions
Use Hypothesis to automatically generate edge-case test data for data transformation functions.
Best for: data function testing
JUnit 5 — Test Patterns and Assertions
Write JUnit 5 tests with assertions, lifecycle hooks, nested tests, parameterized tests, and dynamic tests.
Best for: Unit testing Java applications with JUnit 5
Mockito — Mocking and Verification
Mock dependencies with Mockito: when/thenReturn, verify, argument captors, and spy patterns.
Best for: Testing service layers with mocked dependencies
Spring Boot Integration Testing
Write Spring Boot integration tests with MockMvc, test slices, TestContainers, and mock beans.
Best for: REST API endpoint verification
Testing with JUnit 5 and Kotlin
Write expressive tests in Kotlin: JUnit 5, nested tests, parameterized tests, and extension functions.
Best for: Unit testing Kotlin classes and functions
Testing with Kotest and Assertions
Write expressive tests with Kotest: string spec, data-driven tests, property-based testing, and matchers.
Best for: Expressive Kotlin unit testing
Testing with MockK Framework
Mock dependencies in Kotlin tests with MockK: relaxed mocks, verify, coEvery, and slot captures.
Best for: Unit testing with mocked dependencies
Unit Testing with ScalaTest
Write unit tests with ScalaTest: FunSuite, FlatSpec, matchers, mocking, and async testing.
Best for: Unit testing Scala code
Property-Based Testing with ScalaCheck
Write property-based tests with ScalaCheck: generators, properties, shrinking, and custom Arbitrary.
Best for: Exhaustive testing with random inputs
Testing with Mocks and Stubs
Write testable Scala code with trait-based mocks, stubs, and dependency substitution.
Best for: Unit testing with dependency injection
Testing with Specs2 Framework
Write readable tests with specs2: acceptance specs, matchers, data tables, and mock integration.
Best for: Behavior-driven development