Skip to content

Commit

Permalink
Jest Setup commit with signoff
Browse files Browse the repository at this point in the history
Signed-off-by: Deepali Chavan <deepali.chavan@broadcom.com>
  • Loading branch information
deepalibroadcom committed Oct 22, 2020
1 parent c9ae4f1 commit 7f09a97
Show file tree
Hide file tree
Showing 10 changed files with 8,937 additions and 1,509 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ out
node_modules
.vscode-test/
*.vsix
results
dist
21 changes: 18 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pipeline {
label kubeLabel
yaml kubernetes_config
}
}
}
options {
timestamps()
timeout(time: 3, unit: 'HOURS')
Expand All @@ -60,16 +60,31 @@ pipeline {
}
stage('Package') {
environment {
npm_config_cache = "$env.WORKSPACE"
npm_config_cache = "$env.WORKSPACE"
}
steps {
container('node') {
sh "npx vsce package"
archiveArtifacts "*.vsix"
archiveArtifacts "*.vsix"
sh "mv *$projectName*.vsix '$projectName'_latest.vsix"
}
}
}
stage("Test"){
environment {
DISPLAY = ':99.0'
}
steps{
echo "Executing Test Setup Stage"
// X virtual framebuffer is a display server implementing the X11 display server protocol.
// In contrast to other display servers, Xvfb performs all graphical operations in virtual memory
// without showing any screen output
sh "/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &"

echo "Executing Test Stage"
sh "npm run test"
}
}
stage('Deploy') {
environment {
sshChe4z = "genie.che4z@projects-storage.eclipse.org"
Expand Down
23 changes: 23 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
testEnvironment: 'node', // make test faster

// ts preprocessor
testMatch: ['**/__tests__/**/*.test.ts'],
preset: 'ts-jest',

// coverage
coverageDirectory: '<rootDir>/results/unit/coverage',
coverageReporters: ['text', 'text-summary', 'lcov'],

// reporters
reporters: [
'default',
[
'./node_modules/jest-html-reporter',
{
pageTitle: 'CHE4Z Explorer for Endevor Unit Test Report',
outputPath: 'results/unit/results.html',
},
],
],
};
23 changes: 23 additions & 0 deletions jest.int.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
testEnvironment: 'node', // make test faster

// ts preprocessor
testMatch: ['**/__tests__/sampletests/**/*.test.ts'],
preset: 'ts-jest',

// coverage
coverageDirectory: '<rootDir>/results/unit/coverage',
coverageReporters: ['text', 'text-summary', 'lcov'],

// reporters
reporters: [
'default',
[
'./node_modules/jest-html-reporter',
{
pageTitle: 'CHE4Z Explorer for Endevor Unit Test Report',
outputPath: 'results/unit/results.html',
},
],
],
};
Loading

0 comments on commit 7f09a97

Please sign in to comment.