Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ export default {
},
transformIgnorePatterns: [
"/targets/(es5|es2015|esnext|apache-arrow)/",
"/node_modules/(?!@openpgp/web-stream-tools)/",
],
};
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@openpgp/web-stream-tools": "0.0.13",
"@rollup/plugin-alias": "6.0.0",
"@rollup/plugin-node-resolve": "16.0.3",
"@rollup/stream": "3.0.1",
Expand Down
30 changes: 21 additions & 9 deletions test/unit/ipc/reader/streams-dom-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ import {
Table
} from 'apache-arrow';

// Concatenates multiple ReadableStreams into a single stream
function concatStream<T>(streams: ReadableStream<T>[]): ReadableStream<T> {
return new ReadableStream({
async start(controller) {
for (const stream of streams) {
const reader = stream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done) break;
controller.enqueue(value);
}
} finally {
reader.releaseLock();
}
}
controller.close();
}
});
}

(() => {
if (process.env.TEST_DOM_STREAMS !== 'true') {
return test('not testing DOM streams because process.env.TEST_DOM_STREAMS !== "true"', () => { });
Expand Down Expand Up @@ -101,9 +122,6 @@ import {
}

it('readAll() should pipe to separate WhatWG WritableStreams', async () => {
// @ts-ignore
const { concatStream } = await import('@openpgp/web-stream-tools');

expect.hasAssertions();

const tables = [...generateRandomTables([10, 20, 30])];
Expand Down Expand Up @@ -141,9 +159,6 @@ import {
});

it('should not close the underlying WhatWG ReadableStream when reading multiple tables to completion', async () => {
// @ts-ignore
const { concatStream } = await import('@openpgp/web-stream-tools');

expect.hasAssertions();

const tables = [...generateRandomTables([10, 20, 30])];
Expand Down Expand Up @@ -174,9 +189,6 @@ import {
});

it('should close the underlying WhatWG ReadableStream when reading multiple tables and we break early', async () => {
// @ts-ignore
const { concatStream } = await import('@openpgp/web-stream-tools');

expect.hasAssertions();

const tables = [...generateRandomTables([10, 20, 30])];
Expand Down