mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore: skip tests if needed
This commit is contained in:
parent
6dd2565dca
commit
34a64111cc
2 changed files with 12 additions and 4 deletions
|
@ -11,9 +11,10 @@ import { assert } from '@silverhand/essentials';
|
|||
import { z } from 'zod';
|
||||
|
||||
import { authedAdminApi } from '#src/api/api.js';
|
||||
import { createApplication } from '#src/api/application.js';
|
||||
import { createApplication, deleteApplication } from '#src/api/application.js';
|
||||
import { createResource } from '#src/api/resource.js';
|
||||
import { createScope } from '#src/api/scope.js';
|
||||
import { isDevFeaturesEnabled } from '#src/constants.js';
|
||||
import { WebHookApiTest } from '#src/helpers/hook.js';
|
||||
import {
|
||||
OrganizationApiTest,
|
||||
|
@ -242,12 +243,18 @@ describe('organization data hook events', () => {
|
|||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.cleanUp();
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
await Promise.all([userApi.cleanUp(), deleteApplication(applicationId).catch(() => {})]);
|
||||
});
|
||||
|
||||
it.each(organizationDataHookTestCases)(
|
||||
'test case %#: %p',
|
||||
async ({ route, event, method, endpoint, payload, hookPayload }) => {
|
||||
// TODO: Remove this check
|
||||
if (route.includes('applications') && !isDevFeaturesEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
await authedAdminApi[method](
|
||||
endpoint
|
||||
.replace('{organizationId}', organizationId)
|
||||
|
|
|
@ -8,9 +8,10 @@ import {
|
|||
deleteApplication,
|
||||
} from '#src/api/application.js';
|
||||
import { OrganizationApiTest } from '#src/helpers/organization.js';
|
||||
import { generateTestName } from '#src/utils.js';
|
||||
import { devFeatureTest, generateTestName } from '#src/utils.js';
|
||||
|
||||
describe('organization application APIs', () => {
|
||||
// TODO: Remove this prefix
|
||||
devFeatureTest.describe('organization application APIs', () => {
|
||||
describe('organization - application relations', () => {
|
||||
const organizationApi = new OrganizationApiTest();
|
||||
const applications: Application[] = [];
|
||||
|
|
Loading…
Reference in a new issue