Skip to content

Commit

Permalink
test: remove unneccesary test
Browse files Browse the repository at this point in the history
  • Loading branch information
d-goog committed Sep 6, 2023
1 parent 08dfc51 commit 18973aa
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions test/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4365,31 +4365,6 @@ describe('File', () => {
}
});

it('Destroyed Readable upload should throw', async () => {
const options = {resumable: false};

file.createWriteStream = () => {
throw new Error('unreachable');
};
try {
const readable = new Readable({
read() {
this.push(DATA);
this.push(null);
},
});

readable.destroy();

await file.save(readable, options);
} catch (e) {
assert.strictEqual(
(e as Error).message,
FileExceptionMessages.STREAM_NOT_READABLE
);
}
});

it('should save a generator with no error', done => {
const options = {resumable: false};
file.createWriteStream = () => {
Expand Down Expand Up @@ -4439,33 +4414,6 @@ describe('File', () => {
});
});

it('should error on invalid async iterator data', done => {
const options = {resumable: false};
file.createWriteStream = () => {
const writeStream = new PassThrough();
let errorCalled = false;
writeStream.on('error', () => {
errorCalled = true;
});
writeStream.on('finish', () => {
assert.ok(errorCalled);
});
return writeStream;
};

const generator = async function* () {
yield {thisIsNot: 'a buffer or a string'};
};

file.save(generator(), options, (err: Error) => {
assert.strictEqual(
err.message,
'The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object'
);
done();
});
});

it('buffer upload should retry on first failure', async () => {
const options = {
resumable: false,
Expand Down

0 comments on commit 18973aa

Please sign in to comment.