Skip to content

Commit

Permalink
test: Provide stronger missing provider tests
Browse files Browse the repository at this point in the history
The original code always ended up with no providers at all, which
triggered the expected error. But the point of the test was to test with
only a single missing required provider in each case.
  • Loading branch information
l0b0 committed Dec 4, 2023
1 parent 0e82f66 commit 960eb2a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ o.spec('Historical Imagery Extension Collection', () => {

o('Collection without required provider roles should fail validation', async () => {
// given
for (const role of ['producer', 'licensor', 'processor', 'host']) {
const requiredProviderRoles = ['producer', 'licensor', 'processor', 'host'];
for (const role of requiredProviderRoles) {
const example = JSON.parse(await fs.readFile(examplePath));
example.providers = example.providers.filter((provider) => (!role) in provider.roles);
example.providers = requiredProviderRoles.filter((entry) => entry !== role);

// when
let valid = validate(example);
Expand Down

0 comments on commit 960eb2a

Please sign in to comment.