mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2026-04-25 04:03:03 +00:00
test: pass cloudronCli.* methods directly as it() callbacks
Replaces `it('uninstall app', async () => { await cloudronCli.uninstall(); })`
style wrappers with the bare-method form `it('uninstall app',
cloudronCli.uninstall)` so mocha awaits the returned promise. Also fixes
sync `function () { cloudronCli.appstoreInstall(); }` wrappers around
async methods, where mocha would resolve the test before getAppInfo()
refreshed `app` and the next step would navigate to a stale fqdn.
Made-with: Cursor
This commit is contained in:
+10
-26
@@ -151,19 +151,13 @@ describe('Application life cycle test', function () {
|
||||
|
||||
it('can add and push a file', pushFile);
|
||||
|
||||
it('can restart app', function () {
|
||||
cloudronCli.restart();
|
||||
});
|
||||
it('can restart app', cloudronCli.restart);
|
||||
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', fileExists);
|
||||
|
||||
it('backup app', async function () {
|
||||
await cloudronCli.createBackup();
|
||||
});
|
||||
it('restore app', async function () {
|
||||
await cloudronCli.restoreFromLatestBackup();
|
||||
});
|
||||
it('backup app', cloudronCli.createBackup);
|
||||
it('restore app', cloudronCli.restoreFromLatestBackup);
|
||||
|
||||
it('can login', loginGiteaOIDC);
|
||||
it('can get avatar', checkAvatar);
|
||||
@@ -172,9 +166,7 @@ describe('Application life cycle test', function () {
|
||||
assert.strictEqual(fs.existsSync(`${repodir}/newfile`), true);
|
||||
});
|
||||
|
||||
it('move to different location', async function () {
|
||||
await cloudronCli.changeLocation();
|
||||
});
|
||||
it('move to different location', cloudronCli.changeLocation);
|
||||
|
||||
it('can login', loginGiteaOIDC);
|
||||
it('can get avatar', checkAvatar);
|
||||
@@ -183,9 +175,7 @@ describe('Application life cycle test', function () {
|
||||
assert.strictEqual(fs.existsSync(`${repodir}/newfile`), true);
|
||||
});
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await cloudronCli.uninstall();
|
||||
});
|
||||
it('uninstall app', cloudronCli.uninstall);
|
||||
|
||||
it('install app (no sso)', function () {
|
||||
cloudronCli.install({ noSso: true, tcpPortFlags: INSTALL_TCP_FLAGS });
|
||||
@@ -194,12 +184,10 @@ describe('Application life cycle test', function () {
|
||||
it('can admin login (no sso)', adminLogin);
|
||||
it('can logout', logout);
|
||||
|
||||
it('uninstall app (no sso)', async function () {
|
||||
await cloudronCli.uninstall();
|
||||
});
|
||||
it('uninstall app (no sso)', cloudronCli.uninstall);
|
||||
|
||||
it('can install app', function () {
|
||||
cloudronCli.appstoreInstall({ tcpPortFlags: INSTALL_TCP_FLAGS });
|
||||
it('can install app', async function () {
|
||||
await cloudronCli.appstoreInstall({ tcpPortFlags: INSTALL_TCP_FLAGS });
|
||||
});
|
||||
|
||||
it('can login', loginGiteaOIDCOld);
|
||||
@@ -210,9 +198,7 @@ describe('Application life cycle test', function () {
|
||||
it('can clone the url', cloneRepo);
|
||||
it('can add and push a file', pushFile);
|
||||
|
||||
it('can update', async function () {
|
||||
await cloudronCli.update();
|
||||
});
|
||||
it('can update', cloudronCli.update);
|
||||
|
||||
it('can admin login', adminLogin);
|
||||
it('can logout', logout);
|
||||
@@ -222,7 +208,5 @@ describe('Application life cycle test', function () {
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in cloned repo', fileExists);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await cloudronCli.uninstall();
|
||||
});
|
||||
it('uninstall app', cloudronCli.uninstall);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user