mirror of
https://github.com/directus/directus.git
synced 2026-01-15 01:18:03 -05:00
12 lines
412 B
TypeScript
12 lines
412 B
TypeScript
import { test, expect } from 'vitest';
|
|
import { Readable } from 'node:stream';
|
|
|
|
import { readableStreamToString } from './readable-stream-to-string.js';
|
|
|
|
test.each([Readable.from('test', { encoding: 'utf8' }), Readable.from(Buffer.from([0x74, 0x65, 0x73, 0x74]))])(
|
|
'Returns readable stream as string',
|
|
async (readableStream) => {
|
|
expect(readableStreamToString(readableStream)).resolves.toBe('test');
|
|
},
|
|
);
|