Skip to content

Commit

Permalink
test: fix failing tests due to hardcoded pkg versions (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhongy authored Sep 7, 2023
1 parent 31b971c commit 470a405
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions packages/formspree-core/test/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
8 changes: 6 additions & 2 deletions packages/formspree-react/test/useForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ describe('useForm', () => {
body: expect.any(FormData),
headers: {
Accept: 'application/json',
'Formspree-Client': '@formspree/[email protected] @formspree/[email protected]',
'Formspree-Client': expect.stringMatching(
/^@formspree\/react@[\d.]+ @formspree\/core@[\d.]+$/
),
'Formspree-Session-Data': expect.any(String),
},
method: 'POST',
Expand Down Expand Up @@ -141,7 +143,9 @@ describe('useForm', () => {
body: expect.any(FormData),
headers: {
Accept: 'application/json',
'Formspree-Client': '@formspree/[email protected] @formspree/[email protected]',
'Formspree-Client': expect.stringMatching(
/^@formspree\/react@[\d.]+ @formspree\/core@[\d.]+$/
),
'Formspree-Session-Data': expect.any(String),
},
method: 'POST',
Expand Down

1 comment on commit 470a405

@vercel
Copy link

@vercel vercel bot commented on 470a405 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.