Repository navigation
test: Add Playwright browser config to Vitest; Add GitHub test workflow. #125
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6b30e5
Add playwright browser test
Bill-hbrhbr db8bebd
Rename test to tests. Add GH CI
Bill-hbrhbr aa3c043
Apply suggestions from code review
Bill-hbrhbr 41a6a8e
rename tests to test
Bill-hbrhbr d56f135
Apply suggestion from @Bill-hbrhbr
Bill-hbrhbr 7ae1f57
Update test.yaml
Bill-hbrhbr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: "tests" | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: &monitored_paths | ||
| - ".github/workflows/tests.yaml" | ||
| - "CMakeLists.txt" | ||
| - "package-lock.json" | ||
| - "package.json" | ||
| - "src/**" | ||
| - "taskfile.yaml" | ||
| - "taskfiles/**" | ||
| - "tests/**" | ||
| - "tsconfig.json" | ||
| - "vitest.config.ts" | ||
| push: | ||
| paths: *monitored_paths | ||
| schedule: | ||
| # Run daily at 00:15 UTC (the 15 is to avoid periods of high load) | ||
| - cron: "15 0 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: "${{github.workflow}}-${{github.ref}}" | ||
|
|
||
| # Cancel in-progress jobs for efficiency | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: "ubuntu-24.04" | ||
| steps: | ||
| - uses: "actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8" # v6.0.1 | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install task" | ||
| run: "npm install -g @go-task/cli@3.48.0" | ||
|
|
||
| - name: "Log tool versions" | ||
| run: |- | ||
| cmake --version | ||
| md5sum --version | ||
| node --version | ||
| npm --version | ||
| task --version | ||
|
|
||
| - name: "Run JS tests" | ||
| run: "task tests:js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,5 +16,6 @@ dist | |
| .idea | ||
| .vscode | ||
|
|
||
| # Test data | ||
| /test/data | ||
| # Tests | ||
| /tests/data | ||
| /tests/__screenshots__ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { | ||
| describe, | ||
| expect, | ||
| it, | ||
| } from "vitest"; | ||
|
|
||
| describe("ClpStreamReader", () => { | ||
| it("dummy test", () => { | ||
| expect(true).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| const globalSetup = async () => { | ||
| // no-op global setup for tests | ||
| }; | ||
|
Bill-hbrhbr marked this conversation as resolved.
Resolved
|
||
|
|
||
| export default globalSetup; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,36 @@ | ||
| import {defineConfig} from "vitest/config"; | ||
| import {playwright} from "@vitest/browser-playwright"; | ||
|
|
||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| include: ["test/**/*.test.ts"], | ||
| environment: "node", | ||
| testTimeout: 30_000, | ||
| globalSetup: "tests/globalSetup.ts", | ||
| projects: [ | ||
| { | ||
| test: { | ||
| name: "node", | ||
| include: ["tests/**/*.test.ts"], | ||
| environment: "node", | ||
| testTimeout: 30_000, | ||
| }, | ||
| }, | ||
| { | ||
| test: { | ||
| name: "browser", | ||
| include: ["tests/**/*.test.ts"], | ||
| testTimeout: 30_000, | ||
| browser: { | ||
| enabled: true, | ||
| provider: playwright(), | ||
| instances: [ | ||
| {browser: "chromium"}, | ||
| {browser: "firefox"}, | ||
| {browser: "webkit"}, | ||
| ], | ||
| headless: true, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
|
Bill-hbrhbr marked this conversation as resolved.
Resolved
|
||
| }, | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.