mirror of
https://git.cloudron.io/cloudron/syncthing-app
synced 2026-04-24 11:24:59 +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:
11
test/package-lock.json
generated
11
test/package-lock.json
generated
@@ -10,7 +10,6 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^147.0.1",
|
"chromedriver": "^147.0.1",
|
||||||
"expect.js": "^0.3.1",
|
|
||||||
"mocha": "^11.7.5",
|
"mocha": "^11.7.5",
|
||||||
"selenium-webdriver": "^4.41.0"
|
"selenium-webdriver": "^4.41.0"
|
||||||
}
|
}
|
||||||
@@ -637,11 +636,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": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s="
|
|
||||||
},
|
|
||||||
"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",
|
||||||
@@ -2260,11 +2254,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
|
"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="
|
|
||||||
},
|
|
||||||
"extract-zip": {
|
"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",
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^147.0.1",
|
"chromedriver": "^147.0.1",
|
||||||
"expect.js": "^0.3.1",
|
|
||||||
"mocha": "^11.7.5",
|
"mocha": "^11.7.5",
|
||||||
"selenium-webdriver": "^4.41.0"
|
"selenium-webdriver": "^4.41.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'),
|
||||||
timers = require('timers/promises'),
|
timers = require('timers/promises'),
|
||||||
@@ -50,7 +50,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');
|
||||||
@@ -59,7 +59,7 @@ describe('Application life cycle test', function () {
|
|||||||
function getAppInfo() {
|
function getAppInfo() {
|
||||||
const inspect = JSON.parse(execSync('cloudron inspect'));
|
const 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 waitForElement(elem) {
|
async function waitForElement(elem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user