diff --git a/packages/@tinacms/graphql/tests/all-collections-metadata-query/index.test.ts b/packages/@tinacms/graphql/tests/all-collections-metadata-query/index.test.ts index a1980096d5..67a322b533 100644 --- a/packages/@tinacms/graphql/tests/all-collections-metadata-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/all-collections-metadata-query/index.test.ts @@ -16,5 +16,5 @@ it('retrieves list of all collections', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/basic-document-get/index.test.ts b/packages/@tinacms/graphql/tests/basic-document-get/index.test.ts index 74a2fa6e7b..27e982f787 100644 --- a/packages/@tinacms/graphql/tests/basic-document-get/index.test.ts +++ b/packages/@tinacms/graphql/tests/basic-document-get/index.test.ts @@ -7,21 +7,21 @@ it('has the expected output and writes the expected string', async () => { const { get } = await setup(__dirname, config); const result = await get({ query, variables: {} }); - expect(format(result)).toMatchFileSnapshot('document-query-node.json'); + await expect(format(result)).toMatchFileSnapshot('document-query-node.json'); }); it('retrieves document using node field with ID', async () => { const nodeQuery = `query { node(id: "post/in.md") { ...on Document { _values, _sys { title } }} }`; const { get } = await setup(__dirname, config); const result = await get({ query: nodeQuery, variables: {} }); - expect(format(result)).toMatchFileSnapshot('node-query-node.json'); + await expect(format(result)).toMatchFileSnapshot('node-query-node.json'); }); it('retrieves document using post field', async () => { const postQuery = `query { post(relativePath: "in.md") { _values, _sys { title } } }`; const { get } = await setup(__dirname, config); const result = await get({ query: postQuery, variables: {} }); - expect(format(result)).toMatchFileSnapshot('post-query-node.json'); + await expect(format(result)).toMatchFileSnapshot('post-query-node.json'); }); it('returns a graceful error when document does not exist', async () => { diff --git a/packages/@tinacms/graphql/tests/boolean-filtering-query/index.test.ts b/packages/@tinacms/graphql/tests/boolean-filtering-query/index.test.ts index 14b615149a..627f23b212 100644 --- a/packages/@tinacms/graphql/tests/boolean-filtering-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/boolean-filtering-query/index.test.ts @@ -27,5 +27,5 @@ it('filters movies by boolean archived operations', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/collection-list-query/index.test.ts b/packages/@tinacms/graphql/tests/collection-list-query/index.test.ts index b28ffd58dc..0a389a5990 100644 --- a/packages/@tinacms/graphql/tests/collection-list-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/collection-list-query/index.test.ts @@ -21,7 +21,7 @@ it('retrieves collection document list', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); it('returns empty edges and zero totalCount for an empty collection', async () => { diff --git a/packages/@tinacms/graphql/tests/collection-metadata-query/index.test.ts b/packages/@tinacms/graphql/tests/collection-metadata-query/index.test.ts index a8d73b235d..b15f92f89a 100644 --- a/packages/@tinacms/graphql/tests/collection-metadata-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/collection-metadata-query/index.test.ts @@ -17,5 +17,5 @@ it('retrieves collection metadata and schema information', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/date-filtering-query/index.test.ts b/packages/@tinacms/graphql/tests/date-filtering-query/index.test.ts index 1fe8608272..7e2290f548 100644 --- a/packages/@tinacms/graphql/tests/date-filtering-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/date-filtering-query/index.test.ts @@ -38,5 +38,5 @@ it('filters movies by date using after, before, and between operations', async ( variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/document-creation-mutation/index.test.ts b/packages/@tinacms/graphql/tests/document-creation-mutation/index.test.ts index 9cf31ba957..803073877b 100644 --- a/packages/@tinacms/graphql/tests/document-creation-mutation/index.test.ts +++ b/packages/@tinacms/graphql/tests/document-creation-mutation/index.test.ts @@ -55,11 +55,15 @@ it('creates document with all field types and validates bridge writes', async () query: createMutation, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('createDocument-response.json'); + await expect(format(result)).toMatchFileSnapshot( + 'createDocument-response.json' + ); const newDocWrite = bridge.getWrite('posts/comprehensive-post.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('comprehensive-post-content.md'); + await expect(newDocWrite).toMatchFileSnapshot( + 'comprehensive-post-content.md' + ); }); const createCollectionMutation = ` @@ -112,11 +116,15 @@ it('creates document using createCollection endpoint', async () => { query: createCollectionMutation, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('createCollection-response.json'); + await expect(format(result)).toMatchFileSnapshot( + 'createCollection-response.json' + ); const newDocWrite = bridge.getWrite('posts/create-collection-post.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('create-collection-post-content.md'); + await expect(newDocWrite).toMatchFileSnapshot( + 'create-collection-post-content.md' + ); }); it('validates immediate document availability after creation', async () => { @@ -155,5 +163,7 @@ it('validates immediate document availability after creation', async () => { variables: {}, }); - expect(format(queryResult)).toMatchFileSnapshot('getDocument-response.json'); + await expect(format(queryResult)).toMatchFileSnapshot( + 'getDocument-response.json' + ); }); diff --git a/packages/@tinacms/graphql/tests/document-creation-with-reference/index.test.ts b/packages/@tinacms/graphql/tests/document-creation-with-reference/index.test.ts index 2385a538cf..d2073e79a5 100644 --- a/packages/@tinacms/graphql/tests/document-creation-with-reference/index.test.ts +++ b/packages/@tinacms/graphql/tests/document-creation-with-reference/index.test.ts @@ -28,7 +28,9 @@ it('creates document with reference field without errors', async () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot('createDocument-response.json'); + await expect(format(result)).toMatchFileSnapshot( + 'createDocument-response.json' + ); const newDocWrite = bridge.getWrite('posts/post-with-reference.md'); expect(newDocWrite).toBeDefined(); diff --git a/packages/@tinacms/graphql/tests/document-deletion-mutation/index.test.ts b/packages/@tinacms/graphql/tests/document-deletion-mutation/index.test.ts index cd3efa9721..1b1515ec7a 100644 --- a/packages/@tinacms/graphql/tests/document-deletion-mutation/index.test.ts +++ b/packages/@tinacms/graphql/tests/document-deletion-mutation/index.test.ts @@ -35,7 +35,9 @@ it('deletes document and removes it from queries', async () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot('deleteDocument-response.json'); + await expect(format(result)).toMatchFileSnapshot( + 'deleteDocument-response.json' + ); expect(result.errors).toBeUndefined(); expect(bridge.getDeletes()).toContain('posts/post-to-delete.md'); diff --git a/packages/@tinacms/graphql/tests/document-update-mutation/index.test.ts b/packages/@tinacms/graphql/tests/document-update-mutation/index.test.ts index 19eb75e1e3..c2af83ae58 100644 --- a/packages/@tinacms/graphql/tests/document-update-mutation/index.test.ts +++ b/packages/@tinacms/graphql/tests/document-update-mutation/index.test.ts @@ -44,14 +44,14 @@ it('updates document and validates bridge writes', async () => { }); // Validate GraphQL response - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-document-node.json' ); // Validate Bridge write operations const writes = bridge.getWrites(); expect(writes.size).toBeGreaterThan(0); - expect(bridge.getWrite('posts/in.md')).toMatchFileSnapshot( + await expect(bridge.getWrite('posts/in.md')).toMatchFileSnapshot( 'expected-snapshots/update-document-content.md' ); }); @@ -80,14 +80,14 @@ it('renames document using updateDocument mutation', async () => { }); // Validate GraphQL response - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/rename-document-node.json' ); // Validate Bridge write operations const writes = bridge.getWrites(); expect(writes.size).toBeGreaterThan(0); - expect(bridge.getWrite('posts/renamed-by-bob.md')).toMatchFileSnapshot( + await expect(bridge.getWrite('posts/renamed-by-bob.md')).toMatchFileSnapshot( 'expected-snapshots/rename-document-content.md' ); @@ -136,14 +136,14 @@ it('updates document using updatePost mutation', async () => { }); // Validate GraphQL response - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-post-node.json' ); // Validate Bridge write operations const writes = bridge.getWrites(); expect(writes.size).toBeGreaterThan(0); - expect(bridge.getWrite('posts/in.md')).toMatchFileSnapshot( + await expect(bridge.getWrite('posts/in.md')).toMatchFileSnapshot( 'expected-snapshots/update-post-content.md' ); }); diff --git a/packages/@tinacms/graphql/tests/document-update-with-reference/index.test.ts b/packages/@tinacms/graphql/tests/document-update-with-reference/index.test.ts index 2db69b0543..e96b9561a9 100644 --- a/packages/@tinacms/graphql/tests/document-update-with-reference/index.test.ts +++ b/packages/@tinacms/graphql/tests/document-update-with-reference/index.test.ts @@ -23,12 +23,12 @@ it('executes mutation with reference and validates bridge writes', async () => { variables, }); - expect(format(result)).toMatchFileSnapshot('updated-movie-node.json'); + await expect(format(result)).toMatchFileSnapshot('updated-movie-node.json'); const writes = bridge.getWrites(); expect(writes.size).toBeGreaterThan(0); const movieWrite = bridge.getWrite('movies/in.md'); expect(movieWrite).toBeDefined(); - expect(movieWrite).toMatchFileSnapshot('updated-movie-content.md'); + await expect(movieWrite).toMatchFileSnapshot('updated-movie-content.md'); }); diff --git a/packages/@tinacms/graphql/tests/folder-creation-mutation/index.test.ts b/packages/@tinacms/graphql/tests/folder-creation-mutation/index.test.ts index 25b030d788..d4e0304ad1 100644 --- a/packages/@tinacms/graphql/tests/folder-creation-mutation/index.test.ts +++ b/packages/@tinacms/graphql/tests/folder-creation-mutation/index.test.ts @@ -22,7 +22,9 @@ it('creates folder and validates bridge writes', async () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot('folder-creation-response.json'); + await expect(format(result)).toMatchFileSnapshot( + 'folder-creation-response.json' + ); const folderWrite = bridge.getWrite( 'posts/northwind/company-updates/.gitkeep.md' diff --git a/packages/@tinacms/graphql/tests/is-body/index.test.ts b/packages/@tinacms/graphql/tests/is-body/index.test.ts index 29ef67c23a..4985b7c7ac 100644 --- a/packages/@tinacms/graphql/tests/is-body/index.test.ts +++ b/packages/@tinacms/graphql/tests/is-body/index.test.ts @@ -6,7 +6,7 @@ import input from './in.md?raw'; it('has the expected output and writes the expected string', async () => { const { get, put } = await setup(__dirname, config); const result = await get(); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); await put(assertDoc(result).data.document._values); - expect(input).toMatchFileSnapshot('out.md'); + await expect(input).toMatchFileSnapshot('out.md'); }); diff --git a/packages/@tinacms/graphql/tests/is-title/index.test.ts b/packages/@tinacms/graphql/tests/is-title/index.test.ts index 4c8244e2c8..7e47ab9309 100644 --- a/packages/@tinacms/graphql/tests/is-title/index.test.ts +++ b/packages/@tinacms/graphql/tests/is-title/index.test.ts @@ -6,8 +6,8 @@ import input from './in.md?raw'; it('has the expected output and writes the expected string', async () => { const { get, put } = await setup(__dirname, config); const result = await get(); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); expect(assertDoc(result).data.document._sys.title).toBe('Hello'); await put(assertDoc(result).data.document._values); - expect(input).toMatchFileSnapshot('out.md'); + await expect(input).toMatchFileSnapshot('out.md'); }); diff --git a/packages/@tinacms/graphql/tests/multi-field-sorting-query/index.test.ts b/packages/@tinacms/graphql/tests/multi-field-sorting-query/index.test.ts index b9e091fd8a..8f695a7281 100644 --- a/packages/@tinacms/graphql/tests/multi-field-sorting-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/multi-field-sorting-query/index.test.ts @@ -19,7 +19,7 @@ it('handles multi-field sorting operations using index', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); it('surfaces a GraphQL error when sort key matches no defined index or field', async () => { diff --git a/packages/@tinacms/graphql/tests/numeric-filtering-query/index.test.ts b/packages/@tinacms/graphql/tests/numeric-filtering-query/index.test.ts index 245bd2c10a..be70525438 100644 --- a/packages/@tinacms/graphql/tests/numeric-filtering-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/numeric-filtering-query/index.test.ts @@ -63,5 +63,5 @@ it('filters movies by numeric rating operations', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/pending-document-validation/index.test.ts b/packages/@tinacms/graphql/tests/pending-document-validation/index.test.ts index d10a9589fe..f281292a92 100644 --- a/packages/@tinacms/graphql/tests/pending-document-validation/index.test.ts +++ b/packages/@tinacms/graphql/tests/pending-document-validation/index.test.ts @@ -28,13 +28,13 @@ it('creates pending document with valid parameters', async () => { const { query, bridge } = await setupMutation(__dirname, config); const result = await query({ query: validCreateMutation, variables: {} }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'addPendingDocument-success-response.json' ); const newDocWrite = bridge.getWrite('posts/valid-post.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('valid-post-content.md'); + await expect(newDocWrite).toMatchFileSnapshot('valid-post-content.md'); }); it('handles validation error for invalid collection', async () => { diff --git a/packages/@tinacms/graphql/tests/pending-document-with-template/index.test.ts b/packages/@tinacms/graphql/tests/pending-document-with-template/index.test.ts index 359504dc8a..0549985d1d 100644 --- a/packages/@tinacms/graphql/tests/pending-document-with-template/index.test.ts +++ b/packages/@tinacms/graphql/tests/pending-document-with-template/index.test.ts @@ -30,24 +30,24 @@ it('creates pending document with article template and validates bridge writes', const { query, bridge } = await setupMutation(__dirname, config); const result = await query({ query: createArticleMutation, variables: {} }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'addPendingDocument-article-response.json' ); const newDocWrite = bridge.getWrite('pages/new-article.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('new-article-content.md'); + await expect(newDocWrite).toMatchFileSnapshot('new-article-content.md'); }); it('creates pending document with product template and validates bridge writes', async () => { const { query, bridge } = await setupMutation(__dirname, config); const result = await query({ query: createProductMutation, variables: {} }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'addPendingDocument-product-response.json' ); const newDocWrite = bridge.getWrite('pages/new-product.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('new-product-content.md'); + await expect(newDocWrite).toMatchFileSnapshot('new-product-content.md'); }); diff --git a/packages/@tinacms/graphql/tests/polymorphic-filter-query/index.test.ts b/packages/@tinacms/graphql/tests/polymorphic-filter-query/index.test.ts index 1fe5b5cac8..2b92310387 100644 --- a/packages/@tinacms/graphql/tests/polymorphic-filter-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/polymorphic-filter-query/index.test.ts @@ -45,5 +45,5 @@ it('filters crew by template-specific fields using union types', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/reference-filtering-query/index.test.ts b/packages/@tinacms/graphql/tests/reference-filtering-query/index.test.ts index b3984836a1..e73ebab4e5 100644 --- a/packages/@tinacms/graphql/tests/reference-filtering-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/reference-filtering-query/index.test.ts @@ -35,7 +35,7 @@ it('filters movies by director name using direct reference', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); it('filters movies by nested reference traversal', async () => { @@ -58,5 +58,7 @@ it('filters movies by nested reference traversal', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('nested-reference-node.json'); + await expect(format(result)).toMatchFileSnapshot( + 'nested-reference-node.json' + ); }); diff --git a/packages/@tinacms/graphql/tests/sorting-query/index.test.ts b/packages/@tinacms/graphql/tests/sorting-query/index.test.ts index 04d3d7b00d..fb07863b7f 100644 --- a/packages/@tinacms/graphql/tests/sorting-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/sorting-query/index.test.ts @@ -39,7 +39,7 @@ it('handles single and multi-field sorting operations', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); it('combines sort with filter, returning sorted results from the filtered subset only', async () => { diff --git a/packages/@tinacms/graphql/tests/string-filtering-query/index.test.ts b/packages/@tinacms/graphql/tests/string-filtering-query/index.test.ts index 4ae7fb277c..8e45b78448 100644 --- a/packages/@tinacms/graphql/tests/string-filtering-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/string-filtering-query/index.test.ts @@ -33,5 +33,5 @@ it('filters movies by string title operations', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/template-defined-files/index.test.ts b/packages/@tinacms/graphql/tests/template-defined-files/index.test.ts index c001638ff9..652763d0e5 100644 --- a/packages/@tinacms/graphql/tests/template-defined-files/index.test.ts +++ b/packages/@tinacms/graphql/tests/template-defined-files/index.test.ts @@ -24,7 +24,7 @@ it('queries single template-defined document', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/single-template-document.json' ); }); @@ -61,7 +61,7 @@ it('queries multi-template collection with union types', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/multi-template-collection.json' ); }); @@ -89,7 +89,7 @@ it('queries specific template type from multi-template collection', async () => }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/specific-template-type.json' ); }); @@ -135,13 +135,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/create-author-response.json' ); const newDocWrite = bridge.getWrite('authors/new-author.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot( + await expect(newDocWrite).toMatchFileSnapshot( 'expected-snapshots/new-author-content.md' ); }); @@ -185,11 +185,11 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot('expected-snapshots/create-author-specific-response.json'); + await expect(format(result)).toMatchFileSnapshot('expected-snapshots/create-author-specific-response.json'); const newDocWrite = bridge.getWrite('authors/john-smith.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('expected-snapshots/john-smith-content.md'); + await expect(newDocWrite).toMatchFileSnapshot('expected-snapshots/john-smith-content.md'); }); */ it('creates multi-template collection document with book template', async () => { @@ -231,13 +231,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/create-product-book-response.json' ); const newDocWrite = bridge.getWrite('products/northwind-book.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot( + await expect(newDocWrite).toMatchFileSnapshot( 'expected-snapshots/northwind-book-content.md' ); }); @@ -281,11 +281,11 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot('expected-snapshots/create-product-software-response.json'); + await expect(format(result)).toMatchFileSnapshot('expected-snapshots/create-product-software-response.json'); const newDocWrite = bridge.getWrite('products/northwind-crm.md'); expect(newDocWrite).toBeDefined(); - expect(newDocWrite).toMatchFileSnapshot('expected-snapshots/northwind-crm-content.md'); + await expect(newDocWrite).toMatchFileSnapshot('expected-snapshots/northwind-crm-content.md'); }); */ }); @@ -329,13 +329,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-author-response.json' ); const updatedWrite = bridge.getWrite('authors/bob-northwind.md'); expect(updatedWrite).toBeDefined(); - expect(updatedWrite).toMatchFileSnapshot( + await expect(updatedWrite).toMatchFileSnapshot( 'expected-snapshots/updated-bob-northwind-content.md' ); }); @@ -371,13 +371,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-author-specific-response.json' ); const updatedWrite = bridge.getWrite('authors/bob-northwind.md'); expect(updatedWrite).toBeDefined(); - expect(updatedWrite).toMatchFileSnapshot( + await expect(updatedWrite).toMatchFileSnapshot( 'expected-snapshots/updated-bob-northwind-specific-content.md' ); }); @@ -421,13 +421,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-product-book-response.json' ); const updatedWrite = bridge.getWrite('products/accounting-book.md'); expect(updatedWrite).toBeDefined(); - expect(updatedWrite).toMatchFileSnapshot( + await expect(updatedWrite).toMatchFileSnapshot( 'expected-snapshots/updated-accounting-book-content.md' ); }); @@ -468,13 +468,13 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-product-software-response.json' ); const updatedWrite = bridge.getWrite('products/crm-software.md'); expect(updatedWrite).toBeDefined(); - expect(updatedWrite).toMatchFileSnapshot( + await expect(updatedWrite).toMatchFileSnapshot( 'expected-snapshots/updated-crm-software-content.md' ); }); @@ -507,7 +507,7 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/invalid-template-error.json' ); @@ -542,7 +542,7 @@ describe('Template-Defined Files Mutations', () => { variables: {}, }); - expect(format(result)).toMatchFileSnapshot( + await expect(format(result)).toMatchFileSnapshot( 'expected-snapshots/update-nonexistent-document-error.json' ); diff --git a/packages/@tinacms/graphql/tests/template-query/index.test.ts b/packages/@tinacms/graphql/tests/template-query/index.test.ts index c321d45d0b..bceb43d437 100644 --- a/packages/@tinacms/graphql/tests/template-query/index.test.ts +++ b/packages/@tinacms/graphql/tests/template-query/index.test.ts @@ -27,5 +27,5 @@ it('retrieves template-based document with union types', async () => { }`, variables: {}, }); - expect(format(result)).toMatchFileSnapshot('node.json'); + await expect(format(result)).toMatchFileSnapshot('node.json'); }); diff --git a/packages/@tinacms/graphql/tests/util.ts b/packages/@tinacms/graphql/tests/util.ts index 0be935f589..e399baec17 100644 --- a/packages/@tinacms/graphql/tests/util.ts +++ b/packages/@tinacms/graphql/tests/util.ts @@ -11,7 +11,7 @@ import { z } from 'zod'; class OutputBridge extends FilesystemBridge { async put(_filepath: string, data: string) { - super.put(`out.md`, data); + await super.put(`out.md`, data); } }