Skip to content

Commit 3eb3961

Browse files
convert testUtils to ts (#2074)
1 parent 840f9c7 commit 3eb3961

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-on-rails-pro/tests/testUtils.js renamed to packages/react-on-rails-pro/tests/testUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Readable } from 'stream';
99
* }} Object containing the stream and push function
1010
*/
1111
export const createNodeReadableStream = () => {
12-
const pendingChunks = [];
13-
let pushFn;
12+
const pendingChunks: Buffer[] = [];
13+
let pushFn: ((chunk: Buffer | undefined) => void) | null = null;
1414
const stream = new Readable({
1515
read() {
1616
pushFn = this.push.bind(this);
@@ -20,7 +20,7 @@ export const createNodeReadableStream = () => {
2020
},
2121
});
2222

23-
const push = (chunk) => {
23+
const push = (chunk: Buffer) => {
2424
if (pushFn) {
2525
pushFn(chunk);
2626
} else {

0 commit comments

Comments
 (0)