Skip to content

Commit

Permalink
Adjustments tests
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Cappi <[email protected]>
  • Loading branch information
Fernando Cappi committed Jun 16, 2018
1 parent 4511b61 commit 6711361
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions functions/gcs/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test.serial(`Fails without a bucket`, (t) => {
const expectedMsg = `Bucket not provided. Make sure you have a "bucket" property in your request`;

t.throws(
() => getSample().program.wordCount({ data: { name: `file` } }),
() => getSample().program.wordCount({ name: `file` }),
Error,
expectedMsg
);
Expand All @@ -63,17 +63,15 @@ test.serial(`Fails without a file`, (t) => {
const expectedMsg = `Filename not provided. Make sure you have a "file" property in your request`;

t.throws(
() => getSample().program.wordCount({ data: { bucket: `bucket` } }),
() => getSample().program.wordCount({ bucket: `bucket` }),
Error,
expectedMsg
);
});

test.cb.serial(`Does nothing for deleted files`, (t) => {
const event = {
data: {
resourceState: `not_exists`
}
};
const sample = getSample();

Expand All @@ -89,10 +87,8 @@ test.cb.serial(`Does nothing for deleted files`, (t) => {
test.cb.serial(`Reads the file line by line`, (t) => {
const expectedMsg = `File ${filename} has 114 words`;
const event = {
data: {
bucket: `bucket`,
name: `sample.txt`
}
};

const sample = getSample();
Expand Down

0 comments on commit 6711361

Please sign in to comment.