Fix tests
This commit is contained in:
parent
f4a27e3491
commit
a23669e485
@ -75,22 +75,22 @@ describe(
|
|||||||
it("should create a dir", async () => {
|
it("should create a dir", async () => {
|
||||||
await ffmpeg.createDir("/dir1");
|
await ffmpeg.createDir("/dir1");
|
||||||
const files = await ffmpeg.listDir("/");
|
const files = await ffmpeg.listDir("/");
|
||||||
expect(files).to.include("dir1");
|
expect(files.map(({ name }) => name)).to.include("dir1");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should delete a dir", async () => {
|
it("should delete a dir", async () => {
|
||||||
await ffmpeg.createDir("/dir2");
|
await ffmpeg.createDir("/dir2");
|
||||||
await ffmpeg.deleteDir("/dir2");
|
await ffmpeg.deleteDir("/dir2");
|
||||||
const files = await ffmpeg.listDir("/");
|
const files = await ffmpeg.listDir("/");
|
||||||
expect(files).to.not.include("dir2");
|
expect(files.map(({ name }) => name)).to.not.include("dir2");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should rename a dir", async () => {
|
it("should rename a dir", async () => {
|
||||||
await ffmpeg.createDir("/dir3");
|
await ffmpeg.createDir("/dir3");
|
||||||
await ffmpeg.rename("/dir3", "/dir4");
|
await ffmpeg.rename("/dir3", "/dir4");
|
||||||
const files = await ffmpeg.listDir("/");
|
const files = await ffmpeg.listDir("/");
|
||||||
expect(files).to.not.include("dir3");
|
expect(files.map(({ name }) => name)).to.not.include("dir3");
|
||||||
expect(files).to.include("dir4");
|
expect(files.map(({ name }) => name)).to.include("dir4");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -115,7 +115,7 @@ describe(
|
|||||||
await ffmpeg.writeFile("/file1", text);
|
await ffmpeg.writeFile("/file1", text);
|
||||||
const data = await ffmpeg.readFile("/file1", "utf8");
|
const data = await ffmpeg.readFile("/file1", "utf8");
|
||||||
const files = await ffmpeg.listDir("/");
|
const files = await ffmpeg.listDir("/");
|
||||||
expect(files).to.include("file1");
|
expect(files.map(({ name }) => name)).to.include("file1");
|
||||||
expect(data).to.equal(text);
|
expect(data).to.equal(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ describe(
|
|||||||
await ffmpeg.writeFile("/file2", Uint8Array.from(bin));
|
await ffmpeg.writeFile("/file2", Uint8Array.from(bin));
|
||||||
const data = await ffmpeg.readFile("/file2");
|
const data = await ffmpeg.readFile("/file2");
|
||||||
const files = await ffmpeg.listDir("/");
|
const files = await ffmpeg.listDir("/");
|
||||||
expect(files).to.include("file2");
|
expect(files.map(({ name }) => name)).to.include("file2");
|
||||||
expect(data).to.deep.equal(Uint8Array.from(bin));
|
expect(data).to.deep.equal(Uint8Array.from(bin));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user