Commit 3506848e authored by nanahira's avatar nanahira

unittest

parent 41fa2649
Pipeline #7351 failed with stages
in 41 seconds
stages: stages:
- install
- build - build
- deploy - deploy
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
build: npm_ci:
stage: build stage: install
tags: tags:
- linux - linux
script: script:
- npm ci - npm ci
artifacts:
paths:
- node_modules
.build_base:
stage: build
tags:
- linux
dependencies:
- npm_ci
build:
extends:
- .build_base
script:
- npm run build - npm run build
artifacts: artifacts:
paths: paths:
- dist/ - dist/
unit-test:
extends:
- .build_base
script:
- npm run test
deploy_npm: deploy_npm:
stage: deploy stage: deploy
dependencies: dependencies:
...@@ -27,4 +49,4 @@ deploy_npm: ...@@ -27,4 +49,4 @@ deploy_npm:
- echo $NPMRC | base64 --decode > ~/.npmrc - echo $NPMRC | base64 --decode > ~/.npmrc
- npm publish . || true - npm publish . || true
only: only:
- tags - master
...@@ -7,3 +7,6 @@ ...@@ -7,3 +7,6 @@
.dockerignore .dockerignore
Dockerfile Dockerfile
/src /src
/coverage
/tests
/dist/tests
...@@ -9,3 +9,5 @@ npm install --save-dev \ ...@@ -9,3 +9,5 @@ npm install --save-dev \
'eslint-config-prettier@^8.3.0' \ 'eslint-config-prettier@^8.3.0' \
'eslint-plugin-prettier@^3.4.0' \ 'eslint-plugin-prettier@^3.4.0' \
prettier prettier
mkdir tests || true
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "tsc", "build": "tsc",
"test": "jest --passWithNoTests",
"start": "node dist/index.js" "start": "node dist/index.js"
}, },
"repository": { "repository": {
...@@ -19,5 +20,22 @@ ...@@ -19,5 +20,22 @@
"bugs": { "bugs": {
"url": "https://code.mycard.moe/3rdeye/myproject/issues" "url": "https://code.mycard.moe/3rdeye/myproject/issues"
}, },
"homepage": "https://code.mycard.moe/3rdeye/myproject" "homepage": "https://code.mycard.moe/3rdeye/myproject",
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "tests",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment