test: add unit tests to pipeline

This commit is contained in:
2023-05-31 15:33:19 +02:00
parent 45444d9373
commit 495a63977c
29 changed files with 232 additions and 484 deletions

View File

@@ -20,15 +20,15 @@
"scripts": {
"build": "tsup",
"dev": "tsup --watch --onSuccess \"pnpm run start\"",
"format": "prettier . --ignore-path ../../.gitignore",
"format": "prettier . -c --ignore-path ../../.gitignore",
"format:fix": "prettier --write . --ignore-path ../../.gitignore",
"lint": "tsc --noEmit && eslint --ext .ts src/",
"lint:fix": "eslint --fix --ext .ts src/",
"start": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js",
"start:debug": "cross-env STAPPS_LOG_LEVEL=31 NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js",
"test": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 c8 mocha",
"test": "pnpm run test:unit",
"test:integration": "docker-compose -f integration-test.yml pull && docker-compose -f integration-test.yml up --build --abort-on-container-exit --exit-code-from apicli",
"test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 c8 mocha"
"test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 mocha --exit"
},
"dependencies": {
"@elastic/elasticsearch": "8.4.0",
@@ -76,7 +76,7 @@
"@types/sinon-express-mock": "1.3.9",
"@types/supertest": "2.0.12",
"@types/uuid": "8.3.4",
"c8": "7.13.0",
"c8": "7.14.0",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"conventional-changelog-cli": "2.2.2",

View File

@@ -126,6 +126,5 @@ describe('Bulk Storage', function () {
expect(caught).to.be.equal(123);
});
``;
});
});

View File

@@ -17,7 +17,7 @@
"bin": "app.js",
"scripts": {
"build": "tsup --dts",
"format": "prettier . --ignore-path ../../.gitignore",
"format": "prettier . -c --ignore-path ../../.gitignore",
"format:fix": "prettier --write . --ignore-path ../../.gitignore",
"lint": "eslint --ext .ts src/",
"lint:fix": "eslint --fix --ext .ts src/",
@@ -52,7 +52,7 @@
"@types/sha1": "1.1.3",
"@types/sinon": "10.0.14",
"@types/sinon-chai": "3.2.9",
"c8": "7.13.0",
"c8": "7.14.0",
"chai": "4.3.7",
"mocha": "10.2.0",
"sinon": "15.0.4",