Compare commits

..

2 Commits

Author SHA1 Message Date
Corentin Sechet 76e04b9f8a ci: run javascript unit tests on Jenkins (#75133)
gitea/gadjo/pipeline/head There was a failure building this commit Details
2023-03-07 16:54:39 +01:00
Corentin Sechet 86941a2012 js: integrate jest and jsdom (#75131)
gitea/gadjo/pipeline/head This commit looks good Details
2023-03-07 16:49:14 +01:00
6 changed files with 12 additions and 7119 deletions

1
.gitignore vendored
View File

@ -3,4 +3,3 @@
/dist
/gadjo.egg-info
/gadjo/static/css/icons
node_modules

2
Jenkinsfile vendored
View File

@ -7,8 +7,6 @@ pipeline {
stage('Unit Tests') {
steps {
sh 'tox -rv'
sh 'npm clean-install'
sh 'npm test'
}
post {
always {

7104
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
{
"scripts": {
"test": "jest"
},
"devDependencies": {
"jest": "^29.4.3",
"jquery": "^3.6.3",
"jsdom": "^21.1.0"
}
}

7
setup-node.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
pip install nodeenv
nodeenv --python-virtualenv --prebuilt
npm install -g --no-package-lock --no-save jest jsdom jquery
pip install $*

View File

@ -1,12 +1,15 @@
[tox]
envlist = codestyle-pylint
envlist = codestyle-pylint, jest
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/gadjo/{env:BRANCH_NAME:}
[testenv]
whitelist_externals = bash
deps =
codestyle: pre-commit
pylint: pylint
pylint: pylint-django
install_command =
jest: bash -x setup-node.sh {opts} {packages}
commands =
codestyle: pre-commit run --all-files --show-diff-on-failure
pylint: ./pylint.sh gadjo/
jest: npx jest