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
+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() {