Skip to content

Commit 681d75e

Browse files
committed
chore: adapts tests to new jest version
1 parent c11bcd1 commit 681d75e

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

test/fields/int.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ import { defaultNumber, numberDoc } from './collections/Number';
1515
let client;
1616

1717
describe('Fields', () => {
18-
beforeAll(async (done) => {
18+
beforeAll(async () => {
1919
const { serverURL } = await initPayloadTest({ __dirname, init: { local: false } });
2020
client = new RESTClient(config, { serverURL, defaultSlug: 'point-fields' });
2121
await client.login();
22-
23-
done();
2422
});
2523

2624
describe('text', () => {

test/uploads/int.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ require('isomorphic-fetch');
1616
let client;
1717

1818
describe('Collections - Uploads', () => {
19-
beforeAll(async (done) => {
19+
beforeAll(async () => {
2020
const { serverURL } = await initPayloadTest({ __dirname, init: { local: false } });
2121
client = new RESTClient(config, { serverURL, defaultSlug: mediaSlug });
2222
await client.login();
23-
24-
done();
2523
});
2624

2725
describe('REST', () => {

test/versions/int.spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let globalGraphQLVersionID;
2626
const globalGraphQLOriginalTitle = 'updated global title';
2727

2828
describe('Versions', () => {
29-
beforeAll(async (done) => {
29+
beforeAll(async () => {
3030
const { serverURL } = await initPayloadTest({ __dirname, init: { local: false } });
3131
graphQLURL = `${serverURL}${config.routes.api}${config.routes.graphQL}`;
3232

@@ -43,8 +43,6 @@ describe('Versions', () => {
4343
const response = await request(graphQLURL, login);
4444
token = response.loginUser.token;
4545
graphQLClient = new GraphQLClient(graphQLURL, { headers: { Authorization: `JWT ${token}` } });
46-
47-
done();
4846
});
4947

5048
describe('Collections - Local', () => {
@@ -381,7 +379,7 @@ describe('Versions', () => {
381379
describe('Read', () => {
382380
const updatedTitle = 'updated title';
383381

384-
beforeAll(async (done) => {
382+
beforeAll(async () => {
385383
// modify the post to create a new version
386384
// language=graphQL
387385
const update = `mutation {
@@ -403,7 +401,6 @@ describe('Versions', () => {
403401
const response = await graphQLClient.request(query);
404402

405403
collectionGraphQLVersionID = response.versionsAutosavePosts.docs[0].id;
406-
done();
407404
});
408405

409406
it('should allow read of versions by version id', async () => {
@@ -651,7 +648,7 @@ describe('Versions', () => {
651648

652649
describe('Globals - GraphQL', () => {
653650
describe('Read', () => {
654-
beforeAll(async (done) => {
651+
beforeAll(async () => {
655652
// language=graphql
656653
const update = `mutation {
657654
updateAutosaveGlobal(draft: true, data: {
@@ -678,7 +675,6 @@ describe('Versions', () => {
678675
const response = await graphQLClient.request(query);
679676

680677
globalGraphQLVersionID = response.versionsAutosaveGlobal.docs[0].id;
681-
done();
682678
});
683679

684680
it('should allow read of versions by version id', async () => {

0 commit comments

Comments
 (0)