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