use tsx with mocha
ci / build (push) Failing after 1m54s Details

This commit is contained in:
CJ_Clippy 2024-07-14 08:22:30 -08:00
parent 1be35b5b4e
commit 01c414b6e4
17 changed files with 102 additions and 28 deletions

View File

@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "@CJ_Clippy",

View File

@ -4,7 +4,7 @@
"description": "",
"main": "index.ts",
"scripts": {
"test": "mocha"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "@CJ_Clippy",

View File

@ -15,6 +15,40 @@ importers:
specifier: ^7.0.1
version: 7.5.0
../..: {}
../boop: {}
../bot: {}
../capture: {}
../image: {}
../infra: {}
../next: {}
../scout: {}
../storage: {}
../strapi: {}
../taco: {}
../temporal-worker: {}
../temporal-workflows: {}
../types: {}
../uppy: {}
../utils: {}
../video: {}
packages:
'@aws-crypto/crc32@5.2.0':

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Warn: no test specified\" && exit 0",
"start": "node dist/index.js",
"build": "tsc --build"
},

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Warn: no test specified\" && exit 0",
"start": "node ./dist/index.js",
"dev": "nodemon --ext js,ts,json,yaml --exec \"node --loader ts-node/esm --disable-warning=ExperimentalWarning ./src/index.ts\"",
"build": "tsc --build"

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "",

View File

@ -1,4 +1,6 @@
{
"$schema": "https://json.schemastore.org/mocharc.json",
"extension": ["ts"],
"require": "tsx",
"spec": "src/**/*.spec.ts"
}
}

View File

@ -8,7 +8,7 @@
"./*.js": "./src/*.js"
},
"scripts": {
"test": "mocha",
"test": "mocha --require ts-node/register src/**/*.spec.ts",
"build:worker": "tsc --build ./tsconfig.json",
"start": "echo please use either start:manager or start:worker",
"start:manager": "node --loader ts-node/esm ./src/index.ts",
@ -44,7 +44,6 @@
"qs": "^6.12.1",
"sharp": "^0.33.4",
"slugify": "^1.6.6",
"ts-node": "^10.9.2",
"tsx": "^4.7.2",
"types": "workspace:^",
"xpath": "^0.0.34"
@ -53,6 +52,7 @@
"devDependencies": {
"chai": "^5.1.0",
"mocha": "^10.4.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}

View File

@ -86,9 +86,6 @@ importers:
slugify:
specifier: ^1.6.6
version: 1.6.6
ts-node:
specifier: ^10.9.2
version: 10.9.2(@swc/core@1.6.13)(@types/node@20.14.10)(typescript@5.5.3)
tsx:
specifier: ^4.7.2
version: 4.16.2
@ -105,10 +102,47 @@ importers:
mocha:
specifier: ^10.4.0
version: 10.6.0
ts-node:
specifier: ^10.9.2
version: 10.9.2(@swc/core@1.6.13)(@types/node@20.14.10)(typescript@5.5.3)
typescript:
specifier: ^5.4.5
version: 5.5.3
../..: {}
../archive: {}
../boop: {}
../bot: {}
../capture: {}
../image: {}
../infra: {}
../next: {}
../storage: {}
../strapi: {}
../taco: {}
../temporal-worker: {}
../temporal-workflows: {}
../types: {}
../uppy: {}
../utils: {}
../video: {}
packages:
'@aws-crypto/crc32@5.2.0':

View File

@ -5,7 +5,7 @@ import * as cheerio from 'cheerio'
* @param {String} roomUrl example: https://chaturbate.com/projektmelody
* @returns {Object} initialRoomDossier
*/
export async function getInitialRoomDossier(roomUrl) {
export async function getInitialRoomDossier(roomUrl: string) {
try {
const res = await fetch(roomUrl, {
headers: {
@ -23,8 +23,12 @@ export async function getInitialRoomDossier(roomUrl) {
return dossier;
} catch (error) {
// Handle the error gracefully
console.log(`Error fetching initial room dossier: ${error.message}`);
return null; // Or any other appropriate action you want to take
if (error instanceof Error) {
// Handle the error gracefully
console.error(`Error fetching initial room dossier: ${error.message}`);
return null; // Or any other appropriate action you want to take
} else {
console.error('caught an exotic error, uh-oh')
}
}
}

View File

@ -8,7 +8,7 @@
"./*.js": "./src/*.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "@CJ_Clippy",

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "",

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "",

View File

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "",

View File

@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Warn: no test specified\" && exit 0"
},
"keywords": [],
"author": "",

View File

@ -29,14 +29,14 @@ kubectl -n futureporn exec postgres -- psql -U postgres --command "\
CONNECTION LIMIT = -1 \
IS_TEMPLATE = False;"
kubectl -n futureporn exec postgres -- psql -U postgres --command "\
CREATE DATABASE trigger \
WITH \
OWNER = postgres \
ENCODING = 'UTF8' \
LOCALE_PROVIDER = 'libc' \
CONNECTION LIMIT = -1 \
IS_TEMPLATE = False;"
# kubectl -n futureporn exec postgres -- psql -U postgres --command "\
# CREATE DATABASE trigger \
# WITH \
# OWNER = postgres \
# ENCODING = 'UTF8' \
# LOCALE_PROVIDER = 'libc' \
# CONNECTION LIMIT = -1 \
# IS_TEMPLATE = False;"
# ./temporal-sql-tool -u $(SQL_USER) --pw $(SQL_PASSWORD) -p 5432 --pl postgres12 --db $(TEMPORAL_DB) drop -f