Commit 3506848e authored by nanahira's avatar nanahira

unittest

parent 41fa2649
Pipeline #7351 failed with stages
in 41 seconds
stages:
- install
- build
- deploy
variables:
GIT_DEPTH: "1"
build:
stage: build
npm_ci:
stage: install
tags:
- linux
script:
- npm ci
artifacts:
paths:
- node_modules
.build_base:
stage: build
tags:
- linux
dependencies:
- npm_ci
build:
extends:
- .build_base
script:
- npm run build
artifacts:
paths:
- dist/
unit-test:
extends:
- .build_base
script:
- npm run test
deploy_npm:
stage: deploy
dependencies:
......@@ -27,4 +49,4 @@ deploy_npm:
- echo $NPMRC | base64 --decode > ~/.npmrc
- npm publish . || true
only:
- tags
- master
......@@ -7,3 +7,6 @@
.dockerignore
Dockerfile
/src
/coverage
/tests
/dist/tests
......@@ -9,3 +9,5 @@ npm install --save-dev \
'eslint-config-prettier@^8.3.0' \
'eslint-plugin-prettier@^3.4.0' \
prettier
mkdir tests || true
......@@ -7,6 +7,7 @@
"scripts": {
"lint": "eslint --fix .",
"build": "tsc",
"test": "jest --passWithNoTests",
"start": "node dist/index.js"
},
"repository": {
......@@ -19,5 +20,22 @@
"bugs": {
"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