Suppress Node DEP0040 punycode warning in CLI startup

This commit is contained in:
William Valentin
2026-02-15 20:02:52 -08:00
parent e0f2d27247
commit 6a31ee2885
4 changed files with 77 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { shouldSuppressNodeWarning } from './suppressNodeWarnings.js';
describe('shouldSuppressNodeWarning', () => {
it('suppresses DEP0040 warning code', () => {
expect(shouldSuppressNodeWarning('DEP0040', 'any message')).toBe(true);
});
it('suppresses punycode deprecation by message text', () => {
expect(shouldSuppressNodeWarning(undefined, 'The `punycode` module is deprecated.')).toBe(true);
});
it('does not suppress unrelated warnings', () => {
expect(shouldSuppressNodeWarning('DEP0001', 'different deprecation')).toBe(false);
});
});