Fix typescript tests
This commit is contained in:
parent
007b845cab
commit
db06d13c67
|
@ -2,7 +2,7 @@ process.env.TSX_TSCONFIG_PATH = './packages/tests/tsconfig.json'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"node-option": [
|
"node-option": [
|
||||||
"loader=tsx",
|
"import=tsx",
|
||||||
"no-warnings",
|
"no-warnings",
|
||||||
"conditions=peertube:tsx"
|
"conditions=peertube:tsx"
|
||||||
],
|
],
|
||||||
|
|
|
@ -244,7 +244,7 @@
|
||||||
"swagger-cli": "^4.0.2",
|
"swagger-cli": "^4.0.2",
|
||||||
"tsc-watch": "^6.0.0",
|
"tsc-watch": "^6.0.0",
|
||||||
"tsx": "^4.7.1",
|
"tsx": "^4.7.1",
|
||||||
"typescript": "~5.3.3"
|
"typescript": "~5.2"
|
||||||
},
|
},
|
||||||
"bundlewatch": {
|
"bundlewatch": {
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { arrayify, wait } from '@peertube/peertube-core-utils'
|
||||||
import { JobState, JobType, RunnerJobState } from '@peertube/peertube-models'
|
import { JobState, JobType, RunnerJobState } from '@peertube/peertube-models'
|
||||||
import { PeerTubeServer } from './server.js'
|
import { PeerTubeServer } from './server.js'
|
||||||
|
|
||||||
|
@ -16,10 +16,7 @@ async function waitJobs (
|
||||||
? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
|
? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
|
||||||
: 250
|
: 250
|
||||||
|
|
||||||
let servers: PeerTubeServer[]
|
const servers = arrayify(serversArg)
|
||||||
|
|
||||||
if (Array.isArray(serversArg) === false) servers = [ serversArg ]
|
|
||||||
else servers = serversArg
|
|
||||||
|
|
||||||
const states: JobState[] = [ 'waiting', 'active' ]
|
const states: JobState[] = [ 'waiting', 'active' ]
|
||||||
if (!skipDelayed) states.push('delayed')
|
if (!skipDelayed) states.push('delayed')
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import MarkdownItClass from 'markdown-it'
|
import MarkdownItClass from 'markdown-it'
|
||||||
import markdownItEmoji from 'markdown-it-emoji/lib/light.mjs'
|
// FIXME: use direct import: import markdownItEmoji from 'markdown-it-emoji/lib/light.mjs' if it improves perf'
|
||||||
|
// when https://github.com/privatenumber/tsx/issues/334 is fixed
|
||||||
|
import { light as markdownItEmoji } from 'markdown-it-emoji'
|
||||||
import sanitizeHtml from 'sanitize-html'
|
import sanitizeHtml from 'sanitize-html'
|
||||||
import { getDefaultSanitizeOptions, getTextOnlySanitizeOptions, TEXT_WITH_HTML_RULES } from '@peertube/peertube-core-utils'
|
import { getDefaultSanitizeOptions, getTextOnlySanitizeOptions, TEXT_WITH_HTML_RULES } from '@peertube/peertube-core-utils'
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ function asyncMiddleware (fun: RequestPromiseHandler | RequestPromiseHandler[])
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (const f of fun) {
|
for (const f of (fun as RequestPromiseHandler[])) {
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
return asyncMiddleware(f)(req, res, err => {
|
return asyncMiddleware(f)(req, res, err => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
|
|
|
@ -10264,10 +10264,10 @@ typedarray@^0.0.6:
|
||||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
|
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
|
||||||
|
|
||||||
typescript@~5.3.3:
|
typescript@~5.2:
|
||||||
version "5.3.3"
|
version "5.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
|
||||||
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
|
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
|
||||||
|
|
||||||
uc.micro@^2.0.0:
|
uc.micro@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
|
Loading…
Reference in New Issue