Skip to content

chore: adds example code and README for setting up testing with a payload project#3333

Merged
JarrodMFlesch merged 2 commits into
1.xfrom
example/testing
Oct 9, 2023
Merged

chore: adds example code and README for setting up testing with a payload project#3333
JarrodMFlesch merged 2 commits into
1.xfrom
example/testing

Conversation

@JarrodMFlesch
Copy link
Copy Markdown
Contributor

Description

This adds a new testing folder inside the examples directory. The purpose is to show users how to get up and running with testing within their own payload projects.

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • Change to the examples directory (does not affect core functionality)

Comment thread jest.config.js
Comment on lines +5 to +6
'<rootDir>/src/**/*.spec.ts',
'<rootDir>/test/**/*int.spec.ts',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is anyone opposed to this change? It behaves the same as before, I just wanted to ask as I cannot see why we would need wildcards before the src and test entry points.

@jacobsfletch
Copy link
Copy Markdown
Member

@JarrodMFlesch is this PR still valid? I see the testing example did make its way into main. Do we need to close this one out?

@JarrodMFlesch
Copy link
Copy Markdown
Contributor Author

@jacobsfletch I am going to merge this one into the 1.x branch. I see I need to adjust the testing example on 2.0 as well now too.

@JarrodMFlesch JarrodMFlesch merged commit 88ad2ee into 1.x Oct 9, 2023
@JarrodMFlesch JarrodMFlesch deleted the example/testing branch October 9, 2023 18:37
@jackadair
Copy link
Copy Markdown

Hey @JarrodMFlesch is the current example on 2.0? Just trying to figure out how to pass a different db url for testing but am getting the type error:
Object literal may only specify known properties, and 'mongoURL' does not exist in type 'InitOptions'.

Thanks!

@JarrodMFlesch
Copy link
Copy Markdown
Contributor Author

@jackadair no it is not, good call! I can get this updated today though

@jackadair
Copy link
Copy Markdown

@JarrodMFlesch That would be amazing, thank you 🙏

@jackadair
Copy link
Copy Markdown

@JarrodMFlesch Hey sorry to bother but any update on this?

@JarrodMFlesch
Copy link
Copy Markdown
Contributor Author

Hey @jackadair, thanks for pinging me. Just updated it! Check out this PR to see what needs to be changed when working with Payload 2.x #4431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants