Team Ai
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 21d agoView on Hugging Face
0likes1.2kdownloads
redact.test.ts21 linesDownload Raw Back to unit
1import { redactValue } from '$lib/utils/redact';2import { describe, expect, it } from 'vitest';3 4describe('redactValue', () => {5	it('returns [redacted] by default', () => {6		expect(redactValue('secret-token')).toBe('[redacted]');7	});8 9	it('shows last N characters when showLastChars is provided', () => {10		expect(redactValue('session-abc12', 5)).toBe('....abc12');11	});12 13	it('handles value shorter than showLastChars', () => {14		expect(redactValue('ab', 5)).toBe('....ab');15	});16 17	it('returns [redacted] when showLastChars is 0', () => {18		expect(redactValue('secret', 0)).toBe('[redacted]');19	});20});21