From 82e3ae1523ca6b9013010d9f588213ce4e160403 Mon Sep 17 00:00:00 2001
From: Chocobozzz
Date: Fri, 17 Feb 2023 09:21:11 +0100
Subject: [PATCH] Fix CI
---
package.json | 2 +-
.../metric-helpers/nodejs-observers-builder.ts | 8 ++++----
server/tests/api/notifications/comments-notifications.ts | 5 ++---
yarn.lock | 7 +------
4 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/package.json b/package.json
index 831f4d143..5d1d2e747 100644
--- a/package.json
+++ b/package.json
@@ -197,7 +197,7 @@
"@types/mocha": "^10.0.0",
"@types/morgan": "^1.7.32",
"@types/multer": "^1.3.3",
- "@types/node": "^14.14.31",
+ "@types/node": "^18.13.0",
"@types/nodemailer": "^6.2.0",
"@types/oauth2-server": "^3.0.8",
"@types/request": "^2.0.3",
diff --git a/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts b/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts
index b66fa474c..8ed219e9e 100644
--- a/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts
+++ b/server/lib/opentelemetry/metric-helpers/nodejs-observers-builder.ts
@@ -1,5 +1,5 @@
import { readdir } from 'fs-extra'
-import { constants, PerformanceObserver } from 'perf_hooks'
+import { constants, NodeGCPerformanceDetail, PerformanceObserver } from 'perf_hooks'
import * as process from 'process'
import { Meter, ObservableResult } from '@opentelemetry/api'
import { ExplicitBucketHistogramAggregation } from '@opentelemetry/sdk-metrics'
@@ -110,9 +110,9 @@ export class NodeJSObserversBuilder {
// Node < 16 uses entry.kind
// Node >= 16 uses entry.detail.kind
// See: https://nodejs.org/docs/latest-v16.x/api/deprecations.html#deprecations_dep0152_extension_performanceentry_properties
- const kind = (entry as any).detail
- ? kinds[(entry as any).detail.kind]
- : kinds[entry.kind]
+ const kind = entry.detail
+ ? kinds[(entry.detail as NodeGCPerformanceDetail).kind]
+ : kinds[(entry as any).kind]
// Convert duration from milliseconds to seconds
histogram.record(entry.duration / 1000, {
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts
index 5a50af040..65007193a 100644
--- a/server/tests/api/notifications/comments-notifications.ts
+++ b/server/tests/api/notifications/comments-notifications.ts
@@ -18,9 +18,8 @@ describe('Test comments notifications', function () {
let emails: object[] = []
const commentText = '**hello** world, what do you think about peertube?
'
- const expectedHtml = 'hello ' +
- 'world,
what do you think about peertube?'
+ const expectedHtml = 'hello world' +
+ ', what do you think about peertube?'
before(async function () {
this.timeout(120000)
diff --git a/yarn.lock b/yarn.lock
index f8d9557ef..76c71a1e1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2178,7 +2178,7 @@
dependencies:
"@types/express" "*"
-"@types/node@*", "@types/node@>=10.0.0":
+"@types/node@*", "@types/node@>=10.0.0", "@types/node@^18.13.0":
version "18.13.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850"
integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==
@@ -2188,11 +2188,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708"
integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==
-"@types/node@^14.14.31":
- version "14.18.36"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835"
- integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==
-
"@types/node@^17.0.5":
version "17.0.45"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190"