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:
Generated
-6
@@ -11,7 +11,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/js": "^9.37.0",
|
"@eslint/js": "^9.37.0",
|
||||||
"chromedriver": "^141.0.3",
|
"chromedriver": "^141.0.3",
|
||||||
"expect.js": "^0.3.1",
|
|
||||||
"mocha": "^11.7.4",
|
"mocha": "^11.7.4",
|
||||||
"selenium-webdriver": "^4.36.0",
|
"selenium-webdriver": "^4.36.0",
|
||||||
"superagent": "^10.2.3"
|
"superagent": "^10.2.3"
|
||||||
@@ -719,11 +718,6 @@
|
|||||||
"node": ">=0.10.0"
|
"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": {
|
"node_modules/extract-zip": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/js": "^9.37.0",
|
"@eslint/js": "^9.37.0",
|
||||||
"chromedriver": "^141.0.3",
|
"chromedriver": "^141.0.3",
|
||||||
"expect.js": "^0.3.1",
|
|
||||||
"mocha": "^11.7.4",
|
"mocha": "^11.7.4",
|
||||||
"selenium-webdriver": "^4.36.0",
|
"selenium-webdriver": "^4.36.0",
|
||||||
"superagent": "^10.2.3"
|
"superagent": "^10.2.3"
|
||||||
|
|||||||
+7
-7
@@ -8,7 +8,7 @@
|
|||||||
require('chromedriver');
|
require('chromedriver');
|
||||||
|
|
||||||
const execSync = require('child_process').execSync,
|
const execSync = require('child_process').execSync,
|
||||||
expect = require('expect.js'),
|
assert = require('node:assert/strict'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
superagent = require('superagent'),
|
superagent = require('superagent'),
|
||||||
@@ -51,7 +51,7 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
const currentUrl = await browser.getCurrentUrl();
|
const currentUrl = await browser.getCurrentUrl();
|
||||||
if (!currentUrl.includes(app.domain)) return;
|
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();
|
const screenshotData = await browser.takeScreenshot();
|
||||||
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
|
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() {
|
function getAppInfo() {
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||||
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
|
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() {
|
async function confirmLicense() {
|
||||||
@@ -128,14 +128,14 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
async function checkRedirect() {
|
async function checkRedirect() {
|
||||||
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).set('User-Agent', 'Mozilla/5.0').redirects(0).ok(() => true);
|
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);
|
assert.strictEqual(response.status, 307);
|
||||||
expect(response.headers.location).to.be(`https://${app.fqdn}`);
|
assert.strictEqual(response.headers.location, `https://${app.fqdn}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkApi() {
|
async function checkApi() {
|
||||||
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).ok(() => true);
|
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).ok(() => true);
|
||||||
expect(response.status).to.be(403);
|
assert.strictEqual(response.status, 403);
|
||||||
expect(response.body.toString('utf8')).to.contain('<Code>AccessDenied</Code>');
|
assert.ok(response.body.toString('utf8').includes('<Code>AccessDenied</Code>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeAdminCredentials() {
|
async function changeAdminCredentials() {
|
||||||
|
|||||||
Reference in New Issue
Block a user