Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Mar 19, 2024
1 parent 0418416 commit 7bc2ed9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jest-helpers/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function isOldEnough(isoDatetime: string) {
const date = new Date(isoDatetime);
const currentTime = new Date();

return Number(currentTime) - Number(date) > 60 * 60 * 1000;
return Number(currentTime) - Number(date) > 30 * 60 * 1000;
}

export default async () => {
Expand Down
5 changes: 2 additions & 3 deletions packages/cma-client-node/__tests__/upload.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { generateNewCmaClient } from '../../../jest-helpers/generateNewCmaClient';
import { generateId } from '../../cma-client/src';
import { LogLevel } from '../src';

describe('upload', () => {
it.concurrent('upload local file', async () => {
Expand All @@ -17,13 +16,13 @@ describe('upload', () => {
const client = await generateNewCmaClient();

const upload = await client.uploads.createFromUrl({
url: 'https://www.datocms-assets.com/205/1525789775-dato.png?w=16',
url: 'https://www.datocms-assets.com/205/1525789775-dato.png',
});

expect(upload.path.endsWith('dato.png')).toBeTruthy();

const secondUpload = await client.uploads.createFromUrl({
url: 'https://www.datocms-assets.com/205/1525789775-dato.png?w=16',
url: 'https://www.datocms-assets.com/205/1525789775-dato.png',
skipCreationIfAlreadyExists: true,
});

Expand Down

0 comments on commit 7bc2ed9

Please sign in to comment.