Skip to content

Commit

Permalink
make sure files arent empty
Browse files Browse the repository at this point in the history
  • Loading branch information
goatandsheep committed May 1, 2021
1 parent e161bb4 commit 2e49d15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const PipLib = async function(params, directory) {
console.log('inputArgs', inputArgs)
}

await FfmpegProcessWasm(data, inputArgs, outputFile, true)
const out = await FfmpegProcessWasm(data, inputArgs, outputFile, true)
return fs.promises.writeFile('/data/' + outputFile, out)
} catch (err) {
throw err
Expand All @@ -127,7 +127,7 @@ const FfmpegProcessWasm = async function(data, inputArgs, outputFile, verbose=fa

await ffmpeg.load();
data.forEach((entry) => {
ffmpeg.FS('writeFile', entry.name, entry.data);
ffmpeg.FS('writeFile', entry.name, JSON.stringify(entry.data));
})
await ffmpeg.run(...inputArgs);
return ffmpeg.FS('readFile', '/data/' + outputFile);
Expand Down
8 changes: 4 additions & 4 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const settings = require('./settings');

describe('basic ffmpeg', () => {
it('should process an MP4 file', () => {
expect(() => {
Pip({
expect(async () => {
await Pip({
inputs: [
settings.BASE_INPUT_MP4_FILENAME,
settings.PIP_INPUT_MP4_FILENAME
Expand All @@ -32,8 +32,8 @@ describe('basic ffmpeg', () => {
}).not.toThrow();
})
it('should process 4 videos', () => {
expect(() => {
Pip({
expect(async () => {
await Pip({
inputs: [
settings.BASE_INPUT_MP4_FILENAME,
settings.PIP_INPUT_MP4_FILENAME,
Expand Down

0 comments on commit 2e49d15

Please sign in to comment.