1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2026-05-02 23:25:50 +00:00

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:38:00 +02:00
parent 7794e2e65b
commit 3d5d79ba0b
3 changed files with 7 additions and 14 deletions
-6
View File
@@ -11,7 +11,6 @@
"dependencies": {
"@eslint/js": "^9.37.0",
"chromedriver": "^141.0.3",
"expect.js": "^0.3.1",
"mocha": "^11.7.4",
"selenium-webdriver": "^4.36.0",
"superagent": "^10.2.3"
@@ -719,11 +718,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": "sha512-okDF/FAPEul1ZFLae4hrgpIqAeapoo5TRdcg/lD0iN9S3GWrBFIJwNezGH1DMtIz+RxU4RrFmMq7WUUvDg3J6A=="
},
"node_modules/extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
-1
View File
@@ -11,7 +11,6 @@
"dependencies": {
"@eslint/js": "^9.37.0",
"chromedriver": "^141.0.3",
"expect.js": "^0.3.1",
"mocha": "^11.7.4",
"selenium-webdriver": "^4.36.0",
"superagent": "^10.2.3"
+7 -7
View File
@@ -8,7 +8,7 @@
require('chromedriver');
const execSync = require('child_process').execSync,
expect = require('expect.js'),
assert = require('node:assert/strict'),
fs = require('fs'),
path = require('path'),
superagent = require('superagent'),
@@ -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');
@@ -65,7 +65,7 @@ describe('Application life cycle test', function () {
function getAppInfo() {
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
expect(app).to.be.an('object');
assert.ok(app && typeof app === 'object');
}
async function confirmLicense() {
@@ -128,14 +128,14 @@ describe('Application life cycle test', function () {
async function checkRedirect() {
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).set('User-Agent', 'Mozilla/5.0').redirects(0).ok(() => true);
expect(response.status).to.be(307);
expect(response.headers.location).to.be(`https://${app.fqdn}`);
assert.strictEqual(response.status, 307);
assert.strictEqual(response.headers.location, `https://${app.fqdn}`);
}
async function checkApi() {
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).ok(() => true);
expect(response.status).to.be(403);
expect(response.body.toString('utf8')).to.contain('<Code>AccessDenied</Code>');
assert.strictEqual(response.status, 403);
assert.ok(response.body.toString('utf8').includes('<Code>AccessDenied</Code>'));
}
async function changeAdminCredentials() {