Skip to content

Commit 1301018

Browse files
committed
test: minor test fixes and cleanup
1 parent a1a7bd0 commit 1301018

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

test/__mocks__/parse-duration.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/expiration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TestStorage } from './shared';
22

3-
describe('expiration shorthand', () => {
3+
describe('expiration', () => {
44
it('should normalize string shorthand to ExpirationOptions', () => {
55
const s = new TestStorage({ expiration: '6h' });
66
expect(s.config.expiration).toBeDefined();

test/s3-storage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('S3Storage', () => {
129129
});
130130
});
131131

132-
describe('delete()', () => {
132+
describe('.delete()', () => {
133133
it('should set status', async () => {
134134
s3Mock.on(HeadObjectCommand).resolves(metafileResponse);
135135
s3Mock.on(DeleteObjectCommand).resolves({});
@@ -200,7 +200,7 @@ describe('S3PresignedStorage', () => {
200200
});
201201
});
202202

203-
describe('update', () => {
203+
describe('.update()', () => {
204204
it('should add partsUrls', async () => {
205205
s3Mock.on(HeadObjectCommand).resolves(metafileResponse);
206206
s3Mock.on(ListPartsCommand).resolves({ Parts: [] });

test/storage.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ describe('BaseStorage', () => {
4040

4141
it('should check if not expired', async () => {
4242
storage = new TestStorage({ expiration: { maxAge: '1h' } });
43-
expect(storage.checkIfExpired({ ...metafile, expiredAt: Date.now() + 1000 })).toBeTruthy();
43+
expect(
44+
await storage.checkIfExpired({ ...metafile, expiredAt: Date.now() + 1000 })
45+
).toBeTruthy();
4446
});
4547

4648
it('should save meta and update cache', async () => {

0 commit comments

Comments
 (0)