ci: add CodeQL, formatting check and unit tests - #59
Open
BKPepe wants to merge 2 commits into
Open
Conversation
Trailing whitespace, blank lines and YAML quoting only, so the formatting check starts from a clean slate. No content changes. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
CodeQL scans master and pull requests. Prettier runs via npx with the version pinned in the workflow, and the tests use the built-in node:test runner, so the repo needs no package.json or lockfile. The tests load toh_main.js in a vm context with stubbed browser globals and exercise the pure helpers. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a lightweight CI setup (formatting check, unit tests, and CodeQL) and adds initial Node-based tests for selected helper functions in static/js/toh_main.js.
Changes:
- Add a CI workflow that runs Prettier checks and
node --test. - Add a CodeQL workflow plus a repo-specific CodeQL config.
- Add unit tests that execute
static/js/toh_main.jsin a Nodevmcontext with minimal browser globals.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/toh_main.test.js | Adds unit tests for several helper functions in toh_main.js. |
| tests/helpers/load-toh-main.js | Provides a VM-based loader to execute the browser script in Node tests. |
| README.md | Minor whitespace/formatting cleanup. |
| .prettierrc.json | Adds Prettier config (tabs). |
| .prettierignore | Excludes vendored/upstream files from Prettier checks. |
| .github/workflows/release.yml | Minor formatting adjustments. |
| .github/workflows/release-test.yml | Minor formatting adjustments. |
| .github/workflows/codeql.yml | Adds CodeQL workflow. |
| .github/workflows/ci.yml | Adds CI workflow for formatting + tests. |
| .github/codeql/codeql-config.yml | Adds CodeQL paths-ignore config for vendored bundles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a lightweight CI setup with CodeQL and prettier and a few unit tests.