From c592369955cc4158e9cab586ef6a682f2b204ebd Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Mon, 1 Aug 2022 17:27:30 +0200
Subject: [PATCH] feat(cicd): add unit test job

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1ecbeff..ff5da7b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,6 +32,19 @@ build-dev:
     - git config --global credential.helper store
     - yarn deploy-dev
 
+unit-test:
+  image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.14.2-alpine3.14
+  stage: test
+  script:
+    - yarn
+    - yarn test --ci --reporters=default --reporters=jest-junit
+  coverage: "/All files[^|]*\\|[^|]*\\s+([\\d\\.]+)/"
+  artifacts:
+    when: always
+    reports:
+      junit:
+        - junit.xml
+
 build:
   image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.14.2-alpine3.14
   stage: build
-- 
GitLab