Skip to content

Commit 441117e

Browse files
Merge pull request #2 from hanzalawebdev/feat/unit-tests
fixing error of unit tests and also update Jenkinsfile
2 parents 251cf07 + 038eeed commit 441117e

File tree

7 files changed

+579
-59
lines changed

7 files changed

+579
-59
lines changed

Jenkinsfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pipeline {
2929

3030
stage('Run Unit Tests') {
3131
steps {
32-
sh 'npm run build -- --coverage --reporters=jest-junit'
32+
sh 'npm test'
3333
}
3434
}
3535

@@ -42,15 +42,16 @@ pipeline {
4242

4343
post {
4444
always {
45-
junit 'reports/junit.xml'
46-
archiveArtifacts artifacts: 'reports/**', fingerprint: true
47-
cleanWs(cleanWhenNotBuilt: true, notFailBuild: true)
45+
cleanWs(cleanWhenNotBuilt: false, notFailBuild: true)
4846
}
4947
success {
5048
echo 'Build completed successfully!'
49+
junit '**/reports/junit.xml'
50+
archiveArtifacts artifacts: 'reports/**', fingerprint: true
5151
}
5252
failure {
5353
echo 'Build failed!'
54+
junit '**/reports/junit.xml'
5455
}
5556
}
56-
}
57+
}

0 commit comments

Comments
 (0)