@@ -3,6 +3,8 @@ import { getClient } from '../src/client.js';
33
44const TEST_DOMAIN = process . env . TEST_DOMAIN ;
55const client = getClient ( ) ;
6+ const isIntegrationEnabled = process . env . RUN_INTEGRATION_TESTS === 'true' ;
7+ const describeIntegration = describe . runIf ( isIntegrationEnabled ) ;
68
79// Helper to extract status from nested response
810// Dynadot API has multiple response formats:
@@ -38,19 +40,21 @@ function hasValidResponse(result: Record<string, unknown>): boolean {
3840 return false ;
3941}
4042
41- beforeAll ( ( ) => {
42- if ( ! TEST_DOMAIN ) {
43- throw new Error ( 'TEST_DOMAIN environment variable is required (e.g., example.com)' ) ;
44- }
45- if ( ! process . env . DYNADOT_API_KEY ) {
46- throw new Error ( 'DYNADOT_API_KEY environment variable is required' ) ;
47- }
43+ describeIntegration ( 'Integration test prerequisites' , ( ) => {
44+ beforeAll ( ( ) => {
45+ if ( ! TEST_DOMAIN ) {
46+ throw new Error ( 'TEST_DOMAIN environment variable is required (e.g., example.com)' ) ;
47+ }
48+ if ( ! process . env . DYNADOT_API_KEY ) {
49+ throw new Error ( 'DYNADOT_API_KEY environment variable is required' ) ;
50+ }
51+ } ) ;
4852} ) ;
4953
5054// =============================================================================
5155// TOOL 1: dynadot_domain (11 actions)
5256// =============================================================================
53- describe ( 'dynadot_domain' , ( ) => {
57+ describeIntegration ( 'dynadot_domain' , ( ) => {
5458 describe ( 'read operations' , ( ) => {
5559 it ( 'list - should list all domains' , async ( ) => {
5660 const result = await client . execute ( 'list_domain' ) ;
@@ -137,7 +141,7 @@ describe('dynadot_domain', () => {
137141// =============================================================================
138142// TOOL 2: dynadot_domain_settings (13 actions)
139143// =============================================================================
140- describe ( 'dynadot_domain_settings' , ( ) => {
144+ describeIntegration ( 'dynadot_domain_settings' , ( ) => {
141145 describe ( 'read operations' , ( ) => {
142146 it ( 'get_ns - should get nameservers' , async ( ) => {
143147 const result = await client . execute ( 'get_ns' , { domain : TEST_DOMAIN } ) ;
@@ -245,7 +249,7 @@ describe('dynadot_domain_settings', () => {
245249// =============================================================================
246250// TOOL 3: dynadot_dns (5 actions)
247251// =============================================================================
248- describe ( 'dynadot_dns' , ( ) => {
252+ describeIntegration ( 'dynadot_dns' , ( ) => {
249253 describe ( 'read operations' , ( ) => {
250254 it ( 'get - should get DNS records' , async ( ) => {
251255 const result = await client . execute ( 'get_dns' , { domain : TEST_DOMAIN } ) ;
@@ -289,7 +293,7 @@ describe('dynadot_dns', () => {
289293// =============================================================================
290294// TOOL 4: dynadot_nameserver (6 actions)
291295// =============================================================================
292- describe ( 'dynadot_nameserver' , ( ) => {
296+ describeIntegration ( 'dynadot_nameserver' , ( ) => {
293297 describe ( 'read operations' , ( ) => {
294298 it ( 'list - should list registered nameservers' , async ( ) => {
295299 const result = await client . execute ( 'server_list' ) ;
@@ -334,7 +338,7 @@ describe('dynadot_nameserver', () => {
334338// =============================================================================
335339// TOOL 5: dynadot_transfer (8 actions)
336340// =============================================================================
337- describe ( 'dynadot_transfer' , ( ) => {
341+ describeIntegration ( 'dynadot_transfer' , ( ) => {
338342 describe ( 'read operations' , ( ) => {
339343 it ( 'status - should get transfer status' , async ( ) => {
340344 const result = await client . execute ( 'get_transfer_status' , { domain : TEST_DOMAIN } ) ;
@@ -392,7 +396,7 @@ describe('dynadot_transfer', () => {
392396// =============================================================================
393397// TOOL 6: dynadot_contact (11 actions)
394398// =============================================================================
395- describe ( 'dynadot_contact' , ( ) => {
399+ describeIntegration ( 'dynadot_contact' , ( ) => {
396400 describe ( 'read operations' , ( ) => {
397401 it ( 'list - should list all contacts' , async ( ) => {
398402 const result = await client . execute ( 'contact_list' ) ;
@@ -475,7 +479,7 @@ describe('dynadot_contact', () => {
475479// =============================================================================
476480// TOOL 7: dynadot_folder (15 actions)
477481// =============================================================================
478- describe ( 'dynadot_folder' , ( ) => {
482+ describeIntegration ( 'dynadot_folder' , ( ) => {
479483 describe ( 'read operations' , ( ) => {
480484 it ( 'list - should list all folders' , async ( ) => {
481485 const result = await client . execute ( 'folder_list' ) ;
@@ -592,7 +596,7 @@ describe('dynadot_folder', () => {
592596// =============================================================================
593597// TOOL 8: dynadot_account (13 actions)
594598// =============================================================================
595- describe ( 'dynadot_account' , ( ) => {
599+ describeIntegration ( 'dynadot_account' , ( ) => {
596600 describe ( 'read operations' , ( ) => {
597601 it ( 'info - should get account info' , async ( ) => {
598602 const result = await client . execute ( 'account_info' ) ;
@@ -682,7 +686,7 @@ describe('dynadot_account', () => {
682686// =============================================================================
683687// TOOL 9: dynadot_aftermarket (20 actions)
684688// =============================================================================
685- describe ( 'dynadot_aftermarket' , ( ) => {
689+ describeIntegration ( 'dynadot_aftermarket' , ( ) => {
686690 describe ( 'backorders' , ( ) => {
687691 it ( 'backorder_list - should list backorder requests' , async ( ) => {
688692 const result = await client . execute ( 'backorder_request_list' ) ;
@@ -838,7 +842,7 @@ describe('dynadot_aftermarket', () => {
838842// =============================================================================
839843// TOOL 10: dynadot_order (5 actions)
840844// =============================================================================
841- describe ( 'dynadot_order' , ( ) => {
845+ describeIntegration ( 'dynadot_order' , ( ) => {
842846 describe ( 'read operations' , ( ) => {
843847 it ( 'list - should list recent orders' , async ( ) => {
844848 const today = new Date ( ) ;
0 commit comments