integration: limit config schema tests to only include its own schema
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -30,9 +30,18 @@ describe('readAzureIntegrationConfig', () => {
|
||||
async function buildFrontendConfig(
|
||||
data: Partial<AzureIntegrationConfig>,
|
||||
): Promise<Config> {
|
||||
const schema = await loadConfigSchema({
|
||||
const fullSchema = await loadConfigSchema({
|
||||
dependencies: [require('../../package.json').name],
|
||||
});
|
||||
const serializedSchema = fullSchema.serialize() as {
|
||||
schemas: { path: string }[];
|
||||
};
|
||||
const schema = await loadConfigSchema({
|
||||
serialized: {
|
||||
...serializedSchema, // grab the schema from this package only
|
||||
schemas: serializedSchema.schemas.filter(s => s.path === 'config.d.ts'),
|
||||
},
|
||||
});
|
||||
const processed = schema.process(
|
||||
[{ data: { integrations: { azure: [data] } }, context: 'app' }],
|
||||
{ visibility: ['frontend'] },
|
||||
|
||||
@@ -30,9 +30,18 @@ describe('readBitbucketIntegrationConfig', () => {
|
||||
async function buildFrontendConfig(
|
||||
data: Partial<BitbucketIntegrationConfig>,
|
||||
): Promise<Config> {
|
||||
const schema = await loadConfigSchema({
|
||||
const fullSchema = await loadConfigSchema({
|
||||
dependencies: [require('../../package.json').name],
|
||||
});
|
||||
const serializedSchema = fullSchema.serialize() as {
|
||||
schemas: { path: string }[];
|
||||
};
|
||||
const schema = await loadConfigSchema({
|
||||
serialized: {
|
||||
...serializedSchema, // grab the schema from this package only
|
||||
schemas: serializedSchema.schemas.filter(s => s.path === 'config.d.ts'),
|
||||
},
|
||||
});
|
||||
const processed = schema.process(
|
||||
[{ data: { integrations: { bitbucket: [data] } }, context: 'app' }],
|
||||
{ visibility: ['frontend'] },
|
||||
|
||||
@@ -30,9 +30,18 @@ describe('readGitHubIntegrationConfig', () => {
|
||||
async function buildFrontendConfig(
|
||||
data: Partial<GitHubIntegrationConfig>,
|
||||
): Promise<Config> {
|
||||
const schema = await loadConfigSchema({
|
||||
const fullSchema = await loadConfigSchema({
|
||||
dependencies: [require('../../package.json').name],
|
||||
});
|
||||
const serializedSchema = fullSchema.serialize() as {
|
||||
schemas: { path: string }[];
|
||||
};
|
||||
const schema = await loadConfigSchema({
|
||||
serialized: {
|
||||
...serializedSchema, // grab the schema from this package only
|
||||
schemas: serializedSchema.schemas.filter(s => s.path === 'config.d.ts'),
|
||||
},
|
||||
});
|
||||
const processed = schema.process(
|
||||
[{ data: { integrations: { github: [data] } }, context: 'app' }],
|
||||
{ visibility: ['frontend'] },
|
||||
|
||||
@@ -30,9 +30,18 @@ describe('readGitLabIntegrationConfig', () => {
|
||||
async function buildFrontendConfig(
|
||||
data: Partial<GitLabIntegrationConfig>,
|
||||
): Promise<Config> {
|
||||
const schema = await loadConfigSchema({
|
||||
const fullSchema = await loadConfigSchema({
|
||||
dependencies: [require('../../package.json').name],
|
||||
});
|
||||
const serializedSchema = fullSchema.serialize() as {
|
||||
schemas: { path: string }[];
|
||||
};
|
||||
const schema = await loadConfigSchema({
|
||||
serialized: {
|
||||
...serializedSchema, // grab the schema from this package only
|
||||
schemas: serializedSchema.schemas.filter(s => s.path === 'config.d.ts'),
|
||||
},
|
||||
});
|
||||
const processed = schema.process(
|
||||
[{ data: { integrations: { gitlab: [data] } }, context: 'app' }],
|
||||
{ visibility: ['frontend'] },
|
||||
|
||||
Reference in New Issue
Block a user