0
Fork 0
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:
Gao Sun 2024-06-19 22:55:52 +08:00
parent 6dd2565dca
commit 34a64111cc
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
2 changed files with 12 additions and 4 deletions

View file

@ -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)

View file

@ -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[] = [];