mirror of
https://github.com/directus/directus.git
synced 2026-01-13 23:57:57 -05:00
* Redact env values in revisions for Flows * Add unit tests * Create cold-maps-teach.md * Redact string type envs only Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * Fix linting * Update test for non-string env * Ignore zero length strings Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * Add replacementFn to include key of redacted value * Update cold-maps-teach.md * Remove case insensitivity * Update changeset * Rework * Add utils to changeset * Add unit test * Rename to getRedactedString and add REDACTED_TEXT * Consistent naming --------- Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
13 lines
351 B
TypeScript
13 lines
351 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { getRedactedString } from './get-redacted-string.js';
|
|
|
|
describe('getRedactedString', () => {
|
|
it('redacts without a key', () => {
|
|
expect(getRedactedString()).toBe('--redacted--');
|
|
});
|
|
|
|
it('redacts with a key', () => {
|
|
expect(getRedactedString('A_KEY')).toBe('--redacted:A_KEY--');
|
|
});
|
|
});
|