Files
flynn/src/cli/suppressNodeWarnings.test.ts
T
2026-02-15 20:02:52 -08:00

17 lines
618 B
TypeScript

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);
});
});