Skip to content

Commit 5de1880

Browse files
authored
Merge pull request #3 from atlp-rwanda/ch-setup-codeclimate-187584861
[Delivers #187584861] setup GitHub action to run tests
2 parents 04cc52d + 4cefc4b commit 5de1880

10 files changed

+11935
-6895
lines changed

Diff for: .eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"plugin:@typescript-eslint/recommended",
1919
"plugin:storybook/recommended"
2020
],
21+
"ignorePatterns":["jest.config.ts"],
2122
"rules": {
2223
"react-hooks/rules-of-hooks": "error",
2324
"react-hooks/exhaustive-deps": "warn",

Diff for: .github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [20.x]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Clear npm cache and reinstall dependencies
29+
run: |
30+
npm cache clean --force
31+
npm install
32+
33+
- name: Run tests explicitly with npm run
34+
run: |
35+
npm run test --if-present -- --passWithNoTests
36+
37+
- name: Upload coverage to Coveralls
38+
uses: coverallsapp/github-action@v2
39+
env:
40+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# e-commerce-ninjas-fe
22
Front end repository for the teams' project
33

4+
[![Maintainability](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/maintainability)
5+
[![Test Coverage](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/test_coverage)
6+
[![Netlify Status](https://api.netlify.com/api/v1/badges/a3ed5a75-a862-4f3b-ba21-8369180cf3e6/deploy-status)](https://app.netlify.com/sites/e-commerce-ninja-fn-staging/deploys)
7+
[![Coverage Status](https://coveralls.io/repos/github/atlp-rwanda/e-commerce-ninjas-fe/badge.svg)](https://coveralls.io/github/atlp-rwanda/e-commerce-ninjas-fe)
8+
49
## Completed features
510
- Setup empty react
611
- Setup Redux store

Diff for: jest.config.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "ts-jest",
3+
"testEnvironment": "jsdom",
4+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
5+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6+
"transform": {
7+
"^.+\\.(ts|tsx)$": "ts-jest"
8+
},
9+
"moduleNameMapper": {
10+
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
11+
}
12+
}

0 commit comments

Comments
 (0)