Compare commits

...
Author SHA1 Message Date
Rainer Killinger 233c2246d1 refactor: test exceptions from istanbul to c8 2026-10-26 15:13:14 +01:00
Rainer Killinger e1a018dff1 refactor: dependency updates 2026-10-26 15:13:14 +01:00
26 changed files with 354 additions and 522 deletions

No files matched your search

+5 -5
View File
@@ -49,22 +49,22 @@
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"@types/body-parser": "1.19.6", "@types/body-parser": "1.19.6",
"@types/cors": "2.8.13", "@types/cors": "2.8.13",
"@types/express": "4.17.17", "@types/express": "4.17.21",
"@types/geojson": "1.0.6", "@types/geojson": "1.0.6",
"@types/node": "22.20.5", "@types/node": "22.20.5",
"@types/node-cron": "3.0.7", "@types/node-cron": "3.0.7",
"@types/promise-queue": "2.2.0", "@types/promise-queue": "2.2.0",
"@types/uuid": "8.3.4", "@types/uuid": "8.3.4",
"body-parser": "1.20.3", "body-parser": "1.20.9",
"cors": "2.8.5", "cors": "2.8.5",
"cosmiconfig": "8.1.3", "cosmiconfig": "8.1.3",
"deepmerge": "4.3.1", "deepmerge": "4.3.1",
"express": "4.21.2", "express": "4.22.3",
"express-prom-bundle": "6.6.0", "express-prom-bundle": "6.6.0",
"express-promise-router": "4.1.1", "express-promise-router": "4.1.1",
"got": "14.6.6", "got": "14.6.6",
"moment": "2.30.1", "moment": "2.30.1",
"morgan": "1.10.1", "morgan": "1.12.1",
"nock": "13.3.1", "nock": "13.3.1",
"node-cache": "5.1.2", "node-cache": "5.1.2",
"node-cron": "3.0.2", "node-cron": "3.0.2",
@@ -92,7 +92,7 @@
"cross-env": "7.0.3", "cross-env": "7.0.3",
"get-port": "5.1.1", "get-port": "5.1.1",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"mocked-env": "1.3.5", "mocked-env": "1.3.5",
"sinon": "15.0.4", "sinon": "15.0.4",
"sinon-express-mock": "2.2.1", "sinon-express-mock": "2.2.1",
+1 -1
View File
@@ -65,7 +65,7 @@ export async function configureApp(app: Express, databases: {[name: string]: Dat
}), }),
); );
/* istanbul ignore if */ /* c8 ignore next 3 */
if (process.env.PROMETHEUS_MIDDLEWARE === 'true') { if (process.env.PROMETHEUS_MIDDLEWARE === 'true') {
app.use(getPrometheusMiddleware()); app.use(getPrometheusMiddleware());
} }
+1 -1
View File
@@ -72,7 +72,7 @@
"c8": "10.1.3", "c8": "10.1.3",
"chai": "4.5.0", "chai": "4.5.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"sinon": "15.0.4", "sinon": "15.0.4",
"sinon-chai": "3.7.0", "sinon-chai": "3.7.0",
"ts-node": "10.9.2", "ts-node": "10.9.2",
+3 -3
View File
@@ -78,7 +78,7 @@ Please expose a port if the container should be accessible by NGINX.`);
// Docker Swarm network // Docker Swarm network
if ( if (
/* istanbul ignore next */ /* c8 ignore next 2 */
container.NetworkSettings?.Networks?.ingress?.IPAddress !== undefined && container.NetworkSettings?.Networks?.ingress?.IPAddress !== undefined &&
container.Ports[0].PrivatePort !== undefined container.Ports[0].PrivatePort !== undefined
) { ) {
@@ -326,7 +326,7 @@ export async function getContainers(
const containers = await docker.listContainers(); const containers = await docker.listContainers();
/* istanbul ignore next */ /* c8 ignore next */
if (containers.length === 0) { if (containers.length === 0) {
throw new Error( throw new Error(
`No running docker containers found. `No running docker containers found.
@@ -335,6 +335,6 @@ Please check if docker is running and Node.js can access the docker socket (${pa
); );
} }
/* istanbul ignore next */ /* c8 ignore next */
return containers; return containers;
} }
+1 -1
View File
@@ -61,7 +61,7 @@
"chai": "4.5.0", "chai": "4.5.0",
"chai-as-promised": "7.1.2", "chai-as-promised": "7.1.2",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
"typescript": "5.9.3" "typescript": "5.9.3"
@@ -52,7 +52,7 @@ export async function getUsedVersionMajorMinor(path: PathLike, dependency: strin
const usedVersions = await getUsedVersion(path, dependency); const usedVersions = await getUsedVersion(path, dependency);
const versionMatch = usedVersions.match(/([0-9]+\.[0-9]+)\.[0-9]+/); const versionMatch = usedVersions.match(/([0-9]+\.[0-9]+)\.[0-9]+/);
// istanbul ignore if /* c8 ignore next 3 */
if (versionMatch === null) { if (versionMatch === null) {
throw new Error(`Used version of '${dependency}' of project in '${path}' could not be determined.`); throw new Error(`Used version of '${dependency}' of project in '${path}' could not be determined.`);
} }
+1 -1
View File
@@ -51,7 +51,7 @@
"chai-as-promised": "7.1.2", "chai-as-promised": "7.1.2",
"conventional-changelog-cli": "2.2.2", "conventional-changelog-cli": "2.2.2",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"nock": "13.3.1", "nock": "13.3.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
+2 -2
View File
@@ -34,14 +34,14 @@
"@openstapps/core-tools": "workspace:*", "@openstapps/core-tools": "workspace:*",
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"commander": "10.0.0", "commander": "10.0.0",
"express": "4.21.2", "express": "4.22.3",
"ts-node": "10.9.2" "ts-node": "10.9.2"
}, },
"devDependencies": { "devDependencies": {
"@openstapps/eslint-config": "workspace:*", "@openstapps/eslint-config": "workspace:*",
"@openstapps/prettier-config": "workspace:*", "@openstapps/prettier-config": "workspace:*",
"@openstapps/tsconfig": "workspace:*", "@openstapps/tsconfig": "workspace:*",
"@types/express": "4.17.17", "@types/express": "4.17.21",
"@types/node": "22.20.5", "@types/node": "22.20.5",
"tsup": "8.5.0", "tsup": "8.5.0",
"typescript": "5.9.3" "typescript": "5.9.3"
+1 -1
View File
@@ -164,7 +164,7 @@
"is-docker": "2.2.1", "is-docker": "2.2.1",
"jasmine-core": "5.1.2", "jasmine-core": "5.1.2",
"jasmine-spec-reporter": "7.0.0", "jasmine-spec-reporter": "7.0.0",
"junit-report-merger": "6.0.3", "junit-report-merger": "9.0.4",
"karma": "6.4.4", "karma": "6.4.4",
"karma-chrome-launcher": "3.2.0", "karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1", "karma-coverage": "2.2.1",
+1 -1
View File
@@ -36,7 +36,7 @@
"dotenv-cli": "7.2.1", "dotenv-cli": "7.2.1",
"glob": "10.5.0", "glob": "10.5.0",
"http-server": "14.1.1", "http-server": "14.1.1",
"junit-report-merger": "6.0.3", "junit-report-merger": "9.0.4",
"merge-cobertura": "1.0.1", "merge-cobertura": "1.0.1",
"prettier": "3.1.1", "prettier": "3.1.1",
"syncpack": "12.3.0", "syncpack": "12.3.0",
+2 -2
View File
@@ -40,7 +40,7 @@
"@openstapps/core-tools": "workspace:*", "@openstapps/core-tools": "workspace:*",
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"@types/cli-progress": "3.11.0", "@types/cli-progress": "3.11.0",
"@types/express": "4.17.17", "@types/express": "4.17.21",
"@types/fs-extra": "9.0.13", "@types/fs-extra": "9.0.13",
"@types/json-schema": "7.0.15", "@types/json-schema": "7.0.15",
"@types/junit-report-builder": "3.0.0", "@types/junit-report-builder": "3.0.0",
@@ -65,7 +65,7 @@
"chai-as-promised": "7.1.2", "chai-as-promised": "7.1.2",
"chai-spies": "1.1.0", "chai-spies": "1.1.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"nock": "13.3.1", "nock": "13.3.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
+2 -1
View File
@@ -144,7 +144,8 @@ async function compareItems(suite: junit.TestSuite, errors: string[]) {
await runTest( await runTest(
`Should be the same for ${localThing.type} (${localThing.uid})`, `Should be the same for ${localThing.type} (${localThing.uid})`,
async () => { async () => {
/* istanbul ignore next retrieveItems will throw before*/ // retrieveItems will throw before
/* c8 ignore next 3 */
if (!remoteItemMap.has(localThing.uid)) { if (!remoteItemMap.has(localThing.uid)) {
throw new Error(`Did not retrieve expected SCThing with uid: ${localThing.uid}`); throw new Error(`Did not retrieve expected SCThing with uid: ${localThing.uid}`);
} }
+5 -5
View File
@@ -37,13 +37,13 @@
"@openstapps/core-tools": "workspace:*", "@openstapps/core-tools": "workspace:*",
"@openstapps/logger": "workspace:*", "@openstapps/logger": "workspace:*",
"@types/body-parser": "1.19.6", "@types/body-parser": "1.19.6",
"@types/express": "4.17.17", "@types/express": "4.17.21",
"@types/json-schema": "7.0.15", "@types/json-schema": "7.0.15",
"@types/morgan": "1.9.10", "@types/morgan": "1.9.10",
"body-parser": "1.20.3", "body-parser": "1.20.9",
"express": "4.21.2", "express": "4.22.3",
"json-schema": "0.4.0", "json-schema": "0.4.0",
"morgan": "1.10.1" "morgan": "1.12.1"
}, },
"devDependencies": { "devDependencies": {
"@openstapps/eslint-config": "workspace:*", "@openstapps/eslint-config": "workspace:*",
@@ -59,7 +59,7 @@
"chai-spies": "1.1.0", "chai-spies": "1.1.0",
"conventional-changelog-cli": "2.2.2", "conventional-changelog-cli": "2.2.2",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"nock": "13.3.1", "nock": "13.3.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
+9 -12
View File
@@ -77,20 +77,18 @@ export abstract class Plugin {
protected static normalizePort(value: string) { protected static normalizePort(value: string) {
const portNumber = Number.parseInt(value, 10); const portNumber = Number.parseInt(value, 10);
/* istanbul ignore next */ /* c8 ignore next 4 */
if (Number.isNaN(portNumber)) { if (Number.isNaN(portNumber)) {
// named pipe // named pipe
/* istanbul ignore next */
return value; return value;
} }
/* istanbul ignore next */ /* c8 ignore next 4 */
if (portNumber >= 0) { if (portNumber >= 0) {
// port number // port number
return portNumber; return portNumber;
} }
/* c8 ignore next 2*/
/* istanbul ignore next */
return false; return false;
} }
@@ -122,7 +120,7 @@ export abstract class Plugin {
) { ) {
this.app.use(bodyParser.json()); this.app.use(bodyParser.json());
this.port = Plugin.normalizePort( this.port = Plugin.normalizePort(
/* istanbul ignore next */ /* c8 ignore next */
process.env.PORT === undefined ? port.toString() : process.env.PORT, process.env.PORT === undefined ? port.toString() : process.env.PORT,
); );
this.app.set('port', this.port); this.app.set('port', this.port);
@@ -130,9 +128,8 @@ export abstract class Plugin {
// setup express // setup express
this.server = http.createServer(this.app); this.server = http.createServer(this.app);
this.server.listen(this.port); this.server.listen(this.port);
/* istanbul ignore next */ /* c8 ignore next 3 */
this.server.on('error', error => { this.server.on('error', error => {
/* istanbul ignore next */
this.onError(error); this.onError(error);
}); });
this.server.on('listening', () => { this.server.on('listening', () => {
@@ -161,7 +158,7 @@ export abstract class Plugin {
* @param error The error that occurred * @param error The error that occurred
*/ */
/* istanbul ignore next */ /* c8 ignore start */
private onError(error: ErrnoException) { private onError(error: ErrnoException) {
if (error.syscall !== 'listen') { if (error.syscall !== 'listen') {
throw error; throw error;
@@ -188,13 +185,14 @@ export abstract class Plugin {
} }
} }
} }
/* c8 ignore stop */
/** /**
* Event listener for HTTP server "listening" event. * Event listener for HTTP server "listening" event.
*/ */
private onListening() { private onListening() {
const addr = this.server.address(); const addr = this.server.address();
/* istanbul ignore next */ /* c8 ignore next */
const bind = typeof addr === 'string' ? `pipe ${addr}` : addr === null ? 'null' : `port ${addr.port}`; const bind = typeof addr === 'string' ? `pipe ${addr}` : addr === null ? 'null' : `port ${addr.port}`;
Logger.ok(`Listening on ${bind}`); Logger.ok(`Listening on ${bind}`);
} }
@@ -217,9 +215,8 @@ export abstract class Plugin {
public async close() { public async close() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.server.close(error => { this.server.close(error => {
/* istanbul ignore next */ /* c8 ignore next 3 */
if (error !== undefined) { if (error !== undefined) {
/* istanbul ignore next */
reject(error); reject(error);
} }
resolve(undefined); resolve(undefined);
+1 -1
View File
@@ -52,7 +52,7 @@
"conventional-changelog-cli": "2.2.2", "conventional-changelog-cli": "2.2.2",
"date-fns": "3.6.0", "date-fns": "3.6.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"traverse": "0.6.7", "traverse": "0.6.7",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
+2 -2
View File
@@ -147,7 +147,7 @@ export class Client {
if (response.backend.SCVersion.split('.')[0] !== coreVersion.split('.')[0]) { if (response.backend.SCVersion.split('.')[0] !== coreVersion.split('.')[0]) {
throw new CoreVersionIncompatibleError(coreVersion, response.backend.SCVersion); throw new CoreVersionIncompatibleError(coreVersion, response.backend.SCVersion);
} }
/* istanbul ignore next */ /* c8 ignore next */
this.supportedFeatures = response?.app?.features; this.supportedFeatures = response?.app?.features;
return response; return response;
@@ -164,7 +164,7 @@ export class Client {
const request: SCIndexRequest = {}; const request: SCIndexRequest = {};
const response = await this.invokeRoute<SCIndexResponse>(this.indexRoute, undefined, request); const response = await this.invokeRoute<SCIndexResponse>(this.indexRoute, undefined, request);
if (response?.app?.features !== undefined) { if (response?.app?.features !== undefined) {
/* istanbul ignore next */ /* c8 ignore next */
this.supportedFeatures = response?.app?.features; this.supportedFeatures = response?.app?.features;
} }
} }
+4 -3
View File
@@ -83,7 +83,7 @@ export class ConnectorClient extends Client {
// iterate over all properties // iterate over all properties
for (const key in thingWithoutReferences) { for (const key in thingWithoutReferences) {
/* istanbul ignore if */ /* c8 ignore next 3 */
if (!thingWithoutReferences.hasOwnProperty(key)) { if (!thingWithoutReferences.hasOwnProperty(key)) {
continue; continue;
} }
@@ -112,7 +112,7 @@ export class ConnectorClient extends Client {
// check every property // check every property
for (const itemKey in item) { for (const itemKey in item) {
/* istanbul ignore if */ /* c8 ignore next 3 */
if (!item.hasOwnProperty(itemKey)) { if (!item.hasOwnProperty(itemKey)) {
continue; continue;
} }
@@ -127,6 +127,7 @@ export class ConnectorClient extends Client {
} else if (typeof property === 'object') { } else if (typeof property === 'object') {
// iterate over all properties in nested objects // iterate over all properties in nested objects
for (const nestedKey in property) { for (const nestedKey in property) {
/* c8 ignore next 4 */
if (isThing(property[nestedKey])) { if (isThing(property[nestedKey])) {
// delete properties that are things // delete properties that are things
delete property[nestedKey]; delete property[nestedKey];
@@ -150,7 +151,7 @@ export class ConnectorClient extends Client {
// check each key // check each key
for (const key in object) { for (const key in object) {
/* istanbul ignore if */ /* c8 ignore next 3 */
if (!object.hasOwnProperty(key)) { if (!object.hasOwnProperty(key)) {
continue; continue;
} }
+1 -1
View File
@@ -28,7 +28,7 @@
"c8": "10.1.3", "c8": "10.1.3",
"chai": "4.5.0", "chai": "4.5.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
"typedoc": "0.25.12", "typedoc": "0.25.12",
+1 -1
View File
@@ -80,7 +80,7 @@
"c8": "10.1.3", "c8": "10.1.3",
"chai": "4.5.0", "chai": "4.5.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"nock": "13.3.1", "nock": "13.3.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
+1 -1
View File
@@ -67,7 +67,7 @@
"chai": "4.5.0", "chai": "4.5.0",
"conditional-type-checks": "1.0.6", "conditional-type-checks": "1.0.6",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"source-map-support": "0.5.21", "source-map-support": "0.5.21",
"surge": "0.23.1", "surge": "0.23.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
+1 -1
View File
@@ -38,7 +38,7 @@
"c8": "10.1.3", "c8": "10.1.3",
"chai": "4.5.0", "chai": "4.5.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
"typedoc": "0.25.12" "typedoc": "0.25.12"
+1 -1
View File
@@ -44,7 +44,7 @@
"c8": "10.1.3", "c8": "10.1.3",
"chai": "4.5.0", "chai": "4.5.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"nock": "13.3.1", "nock": "13.3.1",
"rimraf": "5.0.0", "rimraf": "5.0.0",
"ts-node": "10.9.1" "ts-node": "10.9.1"
+1 -1
View File
@@ -46,7 +46,7 @@
"chai-as-promised": "7.1.2", "chai-as-promised": "7.1.2",
"chai-spies": "1.1.0", "chai-spies": "1.1.0",
"mocha": "10.8.2", "mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0", "mocha-junit-reporter": "2.2.1",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"tsup": "8.5.0", "tsup": "8.5.0",
"typedoc": "0.25.12", "typedoc": "0.25.12",
+1 -1
View File
@@ -39,7 +39,7 @@ export function deleteUndefinedProperties(object: unknown): unknown {
// check each key // check each key
for (const key in object) { for (const key in object) {
/* istanbul ignore if */ /* c8 ignore next 3 */
if (!object.hasOwnProperty(key)) { if (!object.hasOwnProperty(key)) {
continue; continue;
} }
+304 -471
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -28,4 +28,4 @@ onlyBuiltDependencies:
- swiper - swiper
overwites: overwites:
undici@>=6.0.0 <6.28.1: '>=6.28.1' undici@>=6.0.0 <6.28.1: '>=6.29.1'