adding-dbt-unit-test

Generate dbt unit test YAML definitions mocking upstream inputs and validating expected outputs.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/niits/voz-company-crawler --skill adding-dbt-unit-test-niits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-dbt-unit-test
Source: https://github.com/niits/voz-company-crawler/tree/main/.agents/skills/adding-dbt-unit-test
Command: npx skills add https://github.com/niits/voz-company-crawler --skill adding-dbt-unit-test-niits

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of unit tests for dbt SQL models, ensuring data quality and preventing regressions by validating model logic against predefined inputs and expected outputs.

Core Features & Use Cases

  • Mocking Inputs: Define mock data for upstream models or sources.
  • Defining Outputs: Specify the expected results of a dbt model.
  • Test Execution: Provides commands to run unit tests independently or as part of a dbt build.
  • Use Case: When developing a new dbt model that transforms customer data, use this Skill to write unit tests that verify the correct calculation of customer segmentation based on various input scenarios.

Quick Start

Use the adding-dbt-unit-test skill to create a unit test for the 'fct_orders' dbt model.

Frequently Asked Questions about adding-dbt-unit-test

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

FAQPage Schema
How do I write unit tests for dbt SQL models?

To write unit tests for dbt SQL models, you generate YAML definitions that mock upstream model inputs and specify expected outputs to validate your model logic against predefined data scenarios.

Can I use test-driven development (TDD) with dbt models?

Yes, you can practice test-driven development with dbt models by defining unit test YAML files that specify expected outputs before finalizing the SQL model transformations, ensuring data quality from the start.

What data formats are supported for mocking dbt unit test inputs?

dbt unit test inputs can be mocked using various data formats including dict, csv, and sql, allowing flexible simulation of upstream model data for validating expected outputs.

Does dbt unit testing work with Snowflake, BigQuery, and Postgres?

Yes, dbt unit testing works with warehouses like BigQuery, Postgres, Redshift, Snowflake, and Spark, providing detailed documentation on supported scenarios and platform-specific caveats for each.

How do I run dbt unit tests independently or during a build?

You can run dbt unit tests independently or as part of a dbt build using specific execution commands provided by the generated YAML definitions to validate model transformations.

What is the best way to prevent data regressions in dbt transformations?

The best way to prevent data regressions in dbt transformations is to implement unit tests that validate model logic against mocked upstream inputs and predefined expected outputs before deployment.