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