w3c / vc-test-suite-implementations

List of W3C Verifiable Credentials Implementations
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

Overwrite default with localConfig.settings. #33

Closed aljones15 closed 3 months ago

aljones15 commented 3 months ago

So I believe this fixes the localConfig.settings to work the way intended.

What is mostly does is this: when using the javascript object spread syntax, the first object is overwritten by the next spread object. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

> const a = {foo: true}
> const b = {foo: false}
// b is last so it's values will take precedence
> const aB = {...a, ...b}
> aB
{ foo: false }
// a is last so it's values will take precedence
> const bA = {...b, ...a}
> bA
{ foo: true }

So basically this PR means that the value of localConfig.settings overwrites the first set of defaults. This means that settings.enableInteropTests and settings.testAllImplementations from a test suite's localConfig will overwrite the defaults enabling you to run your local implementations against remote implementations and interop tests and stuff like that.