Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: config validation #123

Merged
merged 9 commits into from
Jan 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const configSchema = Joi.object({
channel: Joi.string(),
}),
alerts: Joi.array().items(Joi.object({
type: Joi.string(),
type: Joi.string().required(),
byOrg: Joi.boolean(),
mentions: Joi.array().items(Joi.object({ slack: Joi.array().items(Joi.string()) })),
})),
});
}).unknown(true)),
}).unknown(true);

export const DEFAULT_CONFIG = {
slack: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
numberOfSites = 10,
numberOfAuditsPerType = 5,
) {
console.time('Sample data generated in');

Check warning on line 148 in packages/spacecat-shared-data-access/test/it/generateSampleData.js

View workflow job for this annotation

GitHub Actions / Test

Unexpected console statement
await deleteExistingTables([
config.tableNameSites,
config.tableNameAudits,
Expand Down Expand Up @@ -180,6 +180,10 @@
type: '404',
byOrg: true,
mentions: [{ slack: [`${i}-slackId`] }],
},
{
type: 'organic-keywords',
country: 'RO',
}],
},
});
Expand Down Expand Up @@ -235,7 +239,7 @@
await batchWrite(config.tableNameAudits, auditItems);
await batchWrite(config.tableNameLatestAudits, latestAuditItems);

console.log(`Generated ${numberOfOrganizations} organizations`);

Check warning on line 242 in packages/spacecat-shared-data-access/test/it/generateSampleData.js

View workflow job for this annotation

GitHub Actions / Test

Unexpected console statement
console.log(`Generated ${numberOfSites} sites with ${numberOfAuditsPerType} audits per type for each site`);

Check warning on line 243 in packages/spacecat-shared-data-access/test/it/generateSampleData.js

View workflow job for this annotation

GitHub Actions / Test

Unexpected console statement
console.timeEnd('Sample data generated in');

Check warning on line 244 in packages/spacecat-shared-data-access/test/it/generateSampleData.js

View workflow job for this annotation

GitHub Actions / Test

Unexpected console statement
}
Loading