generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated jest action file and script command
- Loading branch information
Fernand
authored and
Fernand
committed
Mar 21, 2024
1 parent
ee6bbb7
commit b49e68d
Showing
6 changed files
with
67 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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,38 @@ | ||
name: Run Jest Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- development | ||
jobs: | ||
test: | ||
permissions: write-all | ||
name: Run Jest Tests | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run tests | ||
run: yarn test | tee ./coverage.txt && exit ${PIPESTATUS[0]} | ||
|
||
- name: Jest Coverage Comment | ||
# Ensures this step is run even on previous step failure (e.g. test failed) | ||
if: always() | ||
uses: MishaKav/jest-coverage-comment@main | ||
with: | ||
coverage-summary-path: coverage/coverage-summary.json | ||
junitxml-path: junit.xml | ||
junitxml-title: JUnit | ||
coverage-path: ./coverage.txt |
This file was deleted.
Oops, something went wrong.
This file contains 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,13 +1,16 @@ | ||
import { config } from "dotenv"; | ||
import type { Config } from "jest"; | ||
|
||
config(); | ||
const GITHUB_TOKEN = process.env.GITHUB_TOKEN; | ||
const OPENAI_API_KEY = process.env.OPENAI_API_KEY; | ||
process.argv = ["path/to/node", "path/to/script", `--auth`, `${GITHUB_TOKEN}`, "--open-ai", `${OPENAI_API_KEY}`]; | ||
|
||
export default { | ||
const cfg: Config = { | ||
transform: { | ||
"^.+\\.tsx?$": "babel-jest", | ||
}, | ||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], | ||
}; | ||
|
||
export default cfg; |
This file contains 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 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 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