Skip to content

Commit

Permalink
Adding unit tests for clinvar export Vue app (#692)
Browse files Browse the repository at this point in the history
Closes: #692
Related-Issue: #692
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Sep 27, 2022
1 parent 22a4f5b commit e2e2c25
Show file tree
Hide file tree
Showing 73 changed files with 17,937 additions and 11,558 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -82,6 +82,12 @@ jobs:
coverage report
- name: check formatting
run: make black arg=--check
- name: Codecov
run: |
curl -s https://uploader.codecov.io/latest/linux/codecov > /tmp/codecov
chmod +x /tmp/codecov
/tmp/codecov -cF python
/tmp/codecov -cF javascript
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
Expand All @@ -98,6 +104,12 @@ jobs:
- name: Run linting
run: flake8
if: ${{ matrix.python-version == '3.8' }}
- name: Run Vue app tests
run: make test_clinvar_export_vue
if: ${{ matrix.python-version == '3.8' }}
- name: Lint Vue app
run: make lint_clinvar_export_vue
if: ${{ matrix.python-version == '3.8' }}

coveralls_finish:
needs: build
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -127,6 +127,7 @@ Full Change List
- Fixing issue with phenotype name in Clinvar (#689).
- Initial vue.js implementation for small variant filtration (#563).
- Changing ClinVar link-out to VCV entry instead of coordinates (#693).
- Adding unit test for clinvar Vue app (#692).

------
v1.2.0
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Expand Up @@ -63,6 +63,15 @@ test: collectstatic
test-noselenium:
VARFISH_KIOSK_MODE=0 SKIP_SELENIUM=1 coverage run manage.py test -v2 --settings=config.settings.test


.PHONY: test_clinvar_export_vue
test_clinvar_export_vue:
npm run --prefix varfish/vueapp test:unit $(arg)

.PHONY: lint_clinvar_export_vue
lint_clinvar_export_vue:
npm run --prefix varfish/vueapp lint $(arg)

.PHONY: lint
lint: flake8

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Expand Up @@ -62,7 +62,7 @@ RUN ["/bin/bash","-c", "cd /tmp && \
rm -f Miniconda3-latest-Linux-x86_64.sh"]

# Install modern nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt install nodejs

# Install npm dependencies.
Expand Down
2 changes: 1 addition & 1 deletion utility/install_os_gitlab.sh
Expand Up @@ -32,5 +32,5 @@ apt-get -y install libldap2-dev
echo "***********************************************"
echo "Installing Node.js"
echo "***********************************************"
curl -sL https://deb.nodesource.com/setup_12.x | bash -
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs
4 changes: 2 additions & 2 deletions utility/install_vue_dev.sh
Expand Up @@ -2,8 +2,8 @@
echo "***********************************************"
echo "Installing Node.js"
echo "***********************************************"
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs npm
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

echo "***********************************************"
echo "Installing Vue CLI and Init"
Expand Down
4 changes: 4 additions & 0 deletions varfish/vueapp/.editorconfig
@@ -1,5 +1,9 @@
[*.{js,jsx,ts,tsx,vue}]
line_length = 120
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.html]
line_length = 120
24 changes: 24 additions & 0 deletions varfish/vueapp/.eslintrc.js
@@ -0,0 +1,24 @@
module.exports = {
plugins: ['simple-import-sort'],
rules: {
'comma-dangle': 0,
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
extends: ['plugin:vue/recommended', '@vue/standard', 'prettier'],
root: true,
env: {
node: true,
},
parserOptions: {
parser: '@babel/eslint-parser',
},
overrides: [
{
files: ['**/tests/unit/**/*.spec.js'],
env: {
jest: true,
},
},
],
}
4 changes: 4 additions & 0 deletions varfish/vueapp/.prettierignore
@@ -0,0 +1,4 @@
/dist/
/coverage/
/webpack-stats.json
.nyc_output
6 changes: 6 additions & 0 deletions varfish/vueapp/README.md
@@ -1,29 +1,35 @@
# vueapp

## Project setup

```
npm install
```

### Compiles and hot-reloads for development

```
npm run serve
```

### Compiles and minifies for production

```
npm run build
```

### Run your unit tests

```
npm run test:unit
```

### Lints and fixes files

```
npm run lint
```

### Customize configuration

See [Configuration Reference](https://cli.vuejs.org/config/).
4 changes: 1 addition & 3 deletions varfish/vueapp/babel.config.js
@@ -1,5 +1,3 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
presets: ['@vue/cli-plugin-babel/preset'],
}
18 changes: 18 additions & 0 deletions varfish/vueapp/jest.config.js
@@ -0,0 +1,18 @@
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{js,vue}',
'!**/index.js',
'!src/constants.js',
'!src/main.js',
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
moduleFileExtensions: ['js', 'json', 'vue'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.vue$': '@vue/vue2-jest',
},
preset: '@vue/cli-plugin-unit-jest',
}

0 comments on commit e2e2c25

Please sign in to comment.