Replace expect.js with node:assert/strict

expect.js is unmaintained and unnecessary — Node's built-in assert
module covers all our assertion patterns. This also removes expect.js
from package.json dependencies.

Made-with: Cursor
This commit is contained in:
Girish Ramakrishnan
2026-04-15 15:37:50 +02:00
parent bc83ba4461
commit 43b6dbc74a
3 changed files with 3 additions and 17 deletions

13
test/package-lock.json generated
View File

@@ -12,7 +12,6 @@
"chromedriver": "^146.0.5"
},
"devDependencies": {
"expect.js": "^0.3.1",
"mocha": "^11.7.5",
"selenium-webdriver": "^4.41.0"
}
@@ -669,12 +668,6 @@
"node": ">=0.10.0"
}
},
"node_modules/expect.js": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz",
"integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=",
"dev": true
},
"node_modules/extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
@@ -2414,12 +2407,6 @@
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
},
"expect.js": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz",
"integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=",
"dev": true
},
"extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",

View File

@@ -9,7 +9,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"expect.js": "^0.3.1",
"mocha": "^11.7.5",
"selenium-webdriver": "^4.41.0"
},

View File

@@ -13,7 +13,7 @@
require('chromedriver');
const execSync = require('child_process').execSync,
expect = require('expect.js'),
assert = require('node:assert/strict'),
fs = require('fs'),
path = require('path'),
{ Builder, By, until } = require('selenium-webdriver'),
@@ -51,7 +51,7 @@ describe('Application life cycle test', function () {
const currentUrl = await browser.getCurrentUrl();
if (!currentUrl.includes(app.domain)) return;
expect(this.currentTest.title).to.be.a('string');
assert.strictEqual(typeof this.currentTest.title, 'string');
const screenshotData = await browser.takeScreenshot();
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
@@ -125,7 +125,7 @@ describe('Application life cycle test', function () {
function getAppInfo() {
const inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION || a.location === LOCATION + '2'; })[0];
expect(app).to.be.an('object');
assert.ok(app && typeof app === 'object');
}
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });