Skip to content
Myr

web-transform.js

This file

Path

test/stdio/web-transform.js

24 lines · 916 bytes · JavaScript

Last changed by

TweaksSindre Sorhusbefore adoption698a1b8

History of this file

Take it

The walk stopped after 200 commits: lines older than 08eb743 point at it.

TweaksSindre Sorhusbefore adoption698a1b8

line 1why, one step back
1import assert from 'node:assert/strict';

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

lines 2–3why, one step back
2import {promisify} from 'node:util';
3import {gunzip} from 'node:zlib';

TweaksSindre Sorhusbefore adoption698a1b8

line 4why, one step back
4import test from 'node:test';

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

lines 5–10why, one step back
5import {execa} from '../../index.js';
6import {setFixtureDirectory} from '../helpers/fixtures-directory.js';7import {foobarString, foobarUtf16Uint8Array, foobarUint8Array} from '../helpers/input.js';89setFixtureDirectory();10

TweaksSindre Sorhusbefore adoption698a1b8

line 11why, one step back
11test('Can use CompressionStream()', async () => {

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

lines 12–13why, one step back
12 const {stdout} = await execa('noop-fd.js', ['1', foobarString], {stdout: new CompressionStream('gzip'), encoding: 'buffer'});
13 const decompressedStdout = await promisify(gunzip)(stdout);

TweaksSindre Sorhusbefore adoption698a1b8

line 14why, one step back
14 assert.equal(decompressedStdout.toString(), foobarString);

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

lines 15–16why, one step back
15});
16

TweaksSindre Sorhusbefore adoption698a1b8

line 17why, one step back
17test('Can use TextDecoderStream()', async () => {

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

lines 18–22why, one step back
18 const {stdout} = await execa('stdin.js', {
19 input: foobarUtf16Uint8Array,20 stdout: new TextDecoderStream('utf-16le'),21 encoding: 'buffer',22 });

TweaksSindre Sorhusbefore adoption698a1b8

line 23why, one step back
23 assert.deepEqual(stdout, foobarUint8Array);

Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743

line 24why, one step back
24});