Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added e2e tests for API endpoints #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mike182uk
Copy link
Member

no refs

Added e2e tests for API endpoints

no refs

Added e2e test for `GET /profile/:handle`
src/app.ts Outdated Show resolved Hide resolved
mysql-testing:
image: mysql:lts
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=activitypub
ports:
- "3308:3306"
Copy link
Member Author

Choose a reason for hiding this comment

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

Useful for debugging test db

@@ -81,6 +81,7 @@ services:
- NODE_ENV=testing
- SKIP_SIGNATURE_VERIFICATION=true
- ALLOW_PRIVATE_ADDRESS=true
- NODE_TLS_REJECT_UNAUTHORIZED=0
Copy link
Member Author

@mike182uk mike182uk Oct 4, 2024

Choose a reason for hiding this comment

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

@allouis I needed to add this otherwise the webfinger lookup on the fake-external-activitypub would not work.

When Fedify does the lookup based on just being provided a handle (@[email protected]) it defaults to using https so i had to expose the --https-port on the wiremock containers. This uses a self signed certificate, so had to enable NODE_TLS_REJECT_UNAUTHORIZED so that node didn't complain about the certificate.

Not sure if i've not set something up correct somewhere thats meaning i need to do this?

no refs

Added e2e test for `GET /actions/search/?query=<string>`
@@ -103,7 +103,7 @@ await configure({
filters: {},
loggers: [
{ category: 'activitypub', sinks: ['console'], level: 'info' },
{ category: 'fedify', sinks: ['console'], level: 'warning' }
{ category: 'fedify', sinks: ['console'], level: process.env.NODE_ENV === 'testing' ? 'debug' : 'warning' }
Copy link
Member Author

Choose a reason for hiding this comment

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

debug was useful to figure out why my test wasn't working 😅

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.

1 participant