Skip to content

Commit

Permalink
examples(file-handling): fix blob creation from stream
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Jul 13, 2023
1 parent eaa0ad2 commit 7f4257f
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions examples/file-handling/test/e2e.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Blob } from "buffer";
import { createReadStream } from "fs";
import { blob } from "node:stream/consumers";
import { mainTestFn, test } from "@compas/cli";
import { dirnameForModule, pathJoin, streamToBuffer } from "@compas/stdlib";
import { dirnameForModule, pathJoin } from "@compas/stdlib";
import {
cleanupTestPostgresDatabase,
objectStorageRemoveBucket,
Expand Down Expand Up @@ -52,16 +52,9 @@ test("e2e", async (t) => {
});

t.test("create post with image", async (t) => {
const headerBlob = new Blob(
await streamToBuffer(
createReadStream(
pathJoin(
dirnameForModule(import.meta),
"..",
"__fixtures__",
"5.jpg",
),
),
const headerBlob = await blob(
createReadStream(
pathJoin(dirnameForModule(import.meta), "..", "__fixtures__", "5.jpg"),
),
);

Expand Down

0 comments on commit 7f4257f

Please sign in to comment.