Fix test suite for CI/CD compatibility

- Fix glob patterns in package.json test scripts (explicit file listing)
- Add error handling for chmod in unix_socket_json.js (test environments)
- Fix unhandled promise rejections in DNS provider contract tests
- Replace broken malformed JSON test with proper buffering test
- Add defensive file cleanup in unix socket tests

All 55 tests now pass successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-31 17:26:24 -05:00
parent c0cfed1b1d
commit 6b8b08e94d
4 changed files with 70 additions and 26 deletions
@@ -162,6 +162,7 @@ function validateMethodSignatures(instance, mockDomain = {domain: 'example.com',
// These tests just verify the methods accept the expected parameters
// and return promises (actual API calls would require real credentials)
// We catch and suppress errors since these calls will fail with mock credentials
// listDomains() should return a promise
const listDomainsResult = instance.listDomains();
@@ -169,6 +170,7 @@ function validateMethodSignatures(instance, mockDomain = {domain: 'example.com',
listDomainsResult instanceof Promise,
`${className}.listDomains() must return a Promise`
);
listDomainsResult.catch(() => {}); // Suppress unhandled rejection
// getRecords(domain, options) should return a promise
const getRecordsResult = instance.getRecords(mockDomain, {type: 'A'});
@@ -176,6 +178,7 @@ function validateMethodSignatures(instance, mockDomain = {domain: 'example.com',
getRecordsResult instanceof Promise,
`${className}.getRecords() must return a Promise`
);
getRecordsResult.catch(() => {}); // Suppress unhandled rejection
// createRecord(domain, options) should return a promise
const createRecordResult = instance.createRecord(mockDomain, {
@@ -187,6 +190,7 @@ function validateMethodSignatures(instance, mockDomain = {domain: 'example.com',
createRecordResult instanceof Promise,
`${className}.createRecord() must return a Promise`
);
createRecordResult.catch(() => {}); // Suppress unhandled rejection
// deleteRecords(domain, options) should return a promise
const deleteRecordsResult = instance.deleteRecords(mockDomain, {
@@ -197,6 +201,7 @@ function validateMethodSignatures(instance, mockDomain = {domain: 'example.com',
deleteRecordsResult instanceof Promise,
`${className}.deleteRecords() must return a Promise`
);
deleteRecordsResult.catch(() => {}); // Suppress unhandled rejection
}
/**