Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
refactor: edit testing
Browse files Browse the repository at this point in the history
Edit Jest config and test script, and add a `test` workflow.
  • Loading branch information
boywithkeyboard committed Aug 2, 2022
1 parent 5401b53 commit d2c5409
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/odd-trainers-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"cachu": patch
---

refactor: edit testing

Edit Jest config and test script, and add a `test` workflow.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Test'

on: [ 'push', 'pull_request' ]

jobs:
publish:
name: 'Test'
runs-on: 'ubuntu-latest'
steps:
- name: 'Git Checkout'
uses: 'actions/checkout@v3'

- name: 'Setup Node.js'
uses: 'actions/setup-node@v3'
with:
node-version: '18.x'
cache: 'npm'

- uses: 'actions/cache@v3'
id: 'cache'
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 'Install Dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: 'npm ci'

- name: 'Test'
run: 'npm test'
4 changes: 4 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"preset": "ts-jest",
"testEnvironment": "node"
}
4 changes: 0 additions & 4 deletions jest.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint src",
"format": "eslint src --fix",
"build": "empty dist && esbuild src/index.ts --bundle --minify --format=esm --legal-comments=none --outfile=dist/index.js",
"test": "jest"
"test": "jest --config jest.config.json"
},
"license": "Apache-2.0",
"repository": "azurystudio/cachu",
Expand Down

0 comments on commit d2c5409

Please sign in to comment.