Skip to content

Commit 0550d7f

Browse files
authored
test: Provide stronger missing provider tests (#280)
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.
1 parent 0e82f66 commit 0550d7f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extensions/historical-imagery/tests/historical-imagery_collection.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ o.spec('Historical Imagery Extension Collection', () => {
9797

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

104105
// when
105106
let valid = validate(example);

0 commit comments

Comments
 (0)