@@ -79,15 +79,22 @@ pub fn build(b: *std.Build) void {
7979 });
8080 const run_matchers_tests = b .addRunArtifact (matchers_tests );
8181
82- // Hooks tests
83- const hooks_tests = b .addTest (.{
82+ // Hooks tests (executable, not unit test)
83+ const hooks_tests = b .addExecutable (.{
84+ .name = "hooks_test" ,
8485 .root_module = b .createModule (.{
8586 .root_source_file = b .path ("tests/hooks_test.zig" ),
8687 .target = target ,
8788 .optimize = optimize ,
89+ .imports = &.{
90+ .{ .name = "zig-test-framework" , .module = lib_module },
91+ },
8892 }),
8993 });
94+ b .installArtifact (hooks_tests );
9095 const run_hooks_tests = b .addRunArtifact (hooks_tests );
96+ const hooks_step = b .step ("test-hooks" , "Run lifecycle hooks tests" );
97+ hooks_step .dependOn (& run_hooks_tests .step );
9198
9299 // Reporter tests
93100 const reporter_tests = b .addTest (.{
@@ -129,14 +136,48 @@ pub fn build(b: *std.Build) void {
129136 });
130137 const run_mock_tests = b .addRunArtifact (mock_tests );
131138
139+ // Comprehensive mock tests (executable)
140+ const comprehensive_mock_tests = b .addExecutable (.{
141+ .name = "comprehensive_mock_test" ,
142+ .root_module = b .createModule (.{
143+ .root_source_file = b .path ("tests/comprehensive_mock_test.zig" ),
144+ .target = target ,
145+ .optimize = optimize ,
146+ .imports = &.{
147+ .{ .name = "zig-test-framework" , .module = lib_module },
148+ },
149+ }),
150+ });
151+ b .installArtifact (comprehensive_mock_tests );
152+ const run_comprehensive_mock_tests = b .addRunArtifact (comprehensive_mock_tests );
153+ const comprehensive_mock_step = b .step ("test-mocks" , "Run comprehensive mock tests" );
154+ comprehensive_mock_step .dependOn (& run_comprehensive_mock_tests .step );
155+
156+ // Snapshot usage tests (executable)
157+ const snapshot_usage_tests = b .addExecutable (.{
158+ .name = "snapshot_usage_test" ,
159+ .root_module = b .createModule (.{
160+ .root_source_file = b .path ("tests/snapshot_usage_test.zig" ),
161+ .target = target ,
162+ .optimize = optimize ,
163+ .imports = &.{
164+ .{ .name = "zig-test-framework" , .module = lib_module },
165+ },
166+ }),
167+ });
168+ b .installArtifact (snapshot_usage_tests );
169+ const run_snapshot_usage_tests = b .addRunArtifact (snapshot_usage_tests );
170+ const snapshot_usage_step = b .step ("test-snapshots" , "Run snapshot usage tests" );
171+ snapshot_usage_step .dependOn (& run_snapshot_usage_tests .step );
172+
132173 // Create test step that runs all tests
133174 const test_step = b .step ("test" , "Run all unit tests" );
134175 test_step .dependOn (& run_lib_unit_tests .step );
135176 test_step .dependOn (& run_test_runner_tests .step );
136177 test_step .dependOn (& run_assertions_tests .step );
137178 test_step .dependOn (& run_suite_tests .step );
138179 test_step .dependOn (& run_matchers_tests .step );
139- test_step . dependOn ( & run_hooks_tests . step );
180+ // Note: hooks_test is an executable, run with 'zig build test-hooks'
140181 test_step .dependOn (& run_reporter_tests .step );
141182 test_step .dependOn (& run_cli_tests .step );
142183 test_step .dependOn (& run_filter_tests .step );
0 commit comments