diff --git a/packages/formspree-core/test/core.test.ts b/packages/formspree-core/test/core.test.ts index 83ae752..4c3a2a5 100644 --- a/packages/formspree-core/test/core.test.ts +++ b/packages/formspree-core/test/core.test.ts @@ -390,7 +390,7 @@ describe('Client.submitForm', () => { headers: { Accept: 'application/json', 'Content-Type': 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -434,7 +434,7 @@ describe('Client.submitForm', () => { headers: { Accept: 'application/json', 'Content-Type': 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -489,7 +489,7 @@ describe('Client.submitForm', () => { headers: { Accept: 'application/json', 'Content-Type': 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -551,7 +551,7 @@ describe('Client.submitForm', () => { body: data, headers: { Accept: 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -565,7 +565,7 @@ describe('Client.submitForm', () => { body: data, headers: { Accept: 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -614,7 +614,7 @@ describe('Client.submitForm', () => { headers: { Accept: 'application/json', 'Content-Type': 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', @@ -634,7 +634,7 @@ describe('Client.submitForm', () => { headers: { Accept: 'application/json', 'Content-Type': 'application/json', - 'Formspree-Client': '@formspree/core@2.8.3', + 'Formspree-Client': `@formspree/core@${version}`, 'Formspree-Session-Data': expectedSessionData, }, method: 'POST', diff --git a/packages/formspree-react/test/useForm.test.tsx b/packages/formspree-react/test/useForm.test.tsx index 2018487..74d976b 100644 --- a/packages/formspree-react/test/useForm.test.tsx +++ b/packages/formspree-react/test/useForm.test.tsx @@ -79,7 +79,9 @@ describe('useForm', () => { body: expect.any(FormData), headers: { Accept: 'application/json', - 'Formspree-Client': '@formspree/react@2.4.4 @formspree/core@2.8.3', + 'Formspree-Client': expect.stringMatching( + /^@formspree\/react@[\d.]+ @formspree\/core@[\d.]+$/ + ), 'Formspree-Session-Data': expect.any(String), }, method: 'POST', @@ -141,7 +143,9 @@ describe('useForm', () => { body: expect.any(FormData), headers: { Accept: 'application/json', - 'Formspree-Client': '@formspree/react@2.4.4 @formspree/core@2.8.3', + 'Formspree-Client': expect.stringMatching( + /^@formspree\/react@[\d.]+ @formspree\/core@[\d.]+$/ + ), 'Formspree-Session-Data': expect.any(String), }, method: 'POST',