Skip to content

Commit

Permalink
Add jest, mock and test example (#58)
Browse files Browse the repository at this point in the history
* Add jest, mock and test example

* Added test automation on the repo

* Added first part unit test for stock count

* fix: feedback correction and finalise unit test

* fix: conflicts and merge master into here

* fix:contacts forms are removed

* fix: unit test failing
  • Loading branch information
ernestoteo authored Sep 27, 2024
1 parent 2e6ced6 commit d956af7
Show file tree
Hide file tree
Showing 18 changed files with 7,215 additions and 2,833 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [push]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15

defaults:
run:
working-directory: .

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run Jest Tests",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": [
"${workspaceFolder}/test/stock-count.spec.js",
"--runInBand",
"--verbose"
],
"console": "integratedTerminal"
}
]
}
Loading

0 comments on commit d956af7

Please sign in to comment.