feat: user usage gql & test case improve (#5076)

This commit is contained in:
DarkSky
2023-12-14 09:50:41 +00:00
parent ad23ead5e4
commit a93c12e122
22 changed files with 364 additions and 132 deletions
+3 -10
View File
@@ -6,17 +6,14 @@ import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import request from 'supertest';
import { AppModule } from '../src/app';
import {
collectMigrations,
RevertCommand,
RunCommand,
} from '../src/data/commands/run';
import { RevertCommand, RunCommand } from '../src/data/commands/run';
import {
acceptInviteById,
createWorkspace,
currentUser,
getPublicWorkspace,
getWorkspacePublicPages,
initFeatureConfigs,
inviteUser,
publishPage,
revokePublicPage,
@@ -53,11 +50,7 @@ test.beforeEach(async t => {
t.context.app = app;
// init features
const run = module.get(RunCommand);
const revert = module.get(RevertCommand);
const migrations = await collectMigrations();
await Promise.allSettled(migrations.map(m => revert.run([m.name])));
await run.run();
await initFeatureConfigs(module);
});
test.afterEach.always(async t => {