-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Checklist
- I have read Caveats documentation and didn't find a solution for this problem there.
Bug description
Attached sample does not work
- I have also tried several permutations on
Readableandfs.ReadStream - Q is unable to help. Q seems to think that my code ought to work.
Here is the error it produces:
Type 'SdkStream<ReadableStream | Blob> | SdkStream<Readable>' is not assignable to type 'StreamingBlobPayloadOutputTypes | undefined'.
Type 'ReadableStream & SdkStreamMixin' is not assignable to type 'StreamingBlobPayloadOutputTypes | undefined'.
Type 'ReadableStream & SdkStreamMixin' is not assignable to type 'Readable & SdkStreamMixin'.
Type 'ReadableStream & SdkStreamMixin' is missing the following properties from type 'Readable': readable, readableEncoding, readableEnded, readableFlowing, and 33 more.ts(2322)
(property) Body?: StreamingBlobPayloadOutputTypes | undefined
Reproduction
import { mockClient } from "aws-sdk-client-mock";
import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
import { sdkStreamMixin } from "@smithy/util-stream";
import fs from "node:fs";
import { Readable } from "node:stream";
const s3ClientMock = mockClient(S3Client);
const trainingData = fs.createReadStream(
__dirname + "path/to/file.csv",
"utf8"
);
describe("oversampleTraining", () => {
beforeEach(() => {
s3ClientMock.reset();
});
it("oversamples the training data", () => {
s3ClientMock.on(GetObjectCommand).resolves({
Body: sdkStreamMixin(Readable.from(trainingData)),
});
});
});
Environment
- Node version: using
bb app -v:: 8.19.4 - Testing lib and version: "jest": "^29.4.3",
- Typescript version: "~4.7.4"
- AWS SDK v3 Client mock version: "^3.1.0"
- AWS JS SDK libs and versions:
- "@aws-sdk/client-s3": "^3.515.0",
vicvytruve and canassa
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working