-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add unit test for the Fastify API #9
Conversation
|
Let's add GitHub action for running the test. |
🚀 Wrote Changes
Hi @jellydn, I decided to make the following changes:
|
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. |
🚀 Wrote Changes
Hi @sweep-ai[bot], I decided to make the following changes:
|
GitHub actions yielded the following error. The command that failed is
Please note that the error message is wrapped in backticks (```) for better visibility. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
1 similar comment
GitHub actions yielded the following error. The command that failed is
Please note that the error message is wrapped in backticks (```) for better visibility. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
Please note that the above lines are wrapped in ```. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
Please note that the error message is wrapped in backticks (`) for better visibility. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
Please note that the error message is wrapped in backticks (```) for better visibility. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
@@ -0,0 +1,5 @@ | |||
import { runFromFile } from '@stepci/runner'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package @stepci/runner
need to add to package.json
as depedence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to make changes. This could be due to an unclear request or a bug in my code.
As a reminder, comments on a file only modify that file. Comments on a PR(at the bottom of the "conversation" tab) can modify the entire PR. Please try again or contact us on Discord
tests/api.test.ts
Outdated
@@ -0,0 +1,42 @@ | |||
import { fastify } from 'fastify'; | |||
import { Server, IncomingMessage, ServerResponse } from 'http'; | |||
import app from '../app'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to export app from app.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Here is example for bun to run test. Please fix the bun test action. jobs:
e2e_test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: setup-bun
name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- id: install-bun
name: Bun Install
run: |
bun install
- id: test
name: E2E Test
run: |
bun run ci |
GitHub actions yielded the following error. The command that failed is
Please note that the error message is wrapped in backticks (```) for better visibility. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. |
🚀 Wrote Changes
Hi @jellydn, I decided to make the following changes:
|
tests/api.test.ts
Outdated
@@ -0,0 +1,42 @@ | |||
import { fastify } from 'fastify'; | |||
import { Server, IncomingMessage, ServerResponse } from 'http'; | |||
import app from '../app'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import app from '../app'; | |
import { server as app } from '../server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines are wrapped in ```. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines are wrapped in ```. This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error.
The command that failed is This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
PR Feedback: 👎
Description
This PR adds a unit test for the Fastify API in the stepci-demo repository. The unit test is implemented using the
bun
package manager and the@stepci/runner
library. The test script is added to the package.json file, and a new test file,tests/api.test.ts
, is created to write the tests for the Fastify API endpoints. Additionally, a new file,stepci.js
, is created to use the@stepci/runner
package to run the tests.Summary of Changes
tests/api.test.ts
, to write tests for the Fastify API endpoints.stepci.js
, to use the@stepci/runner
package to run the tests.Please review and merge this PR to add unit tests for the Fastify API.
Fixes #5.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: