Skip to content

Commit 09fd679

Browse files
committed
Add latest local testing setup info.
1 parent 0b89e26 commit 09fd679

File tree

1 file changed

+23
-32
lines changed

1 file changed

+23
-32
lines changed

README.md

+23-32
Original file line numberDiff line numberDiff line change
@@ -110,43 +110,34 @@ of using the test suite API; be capable of signing and/or verifying using `did:k
110110
- https://www.w3.org/2018/credentials/v1
111111
- https://www.w3.org/ns/credentials/v2
112112

113-
### Testing locally
113+
#### Testing locally
114114

115-
If you need to test implementations for endpoints running locally, create a
116-
config file in the root dir of the test suite:
117-
118-
```
119-
.localImplementationsConfig.cjs
120-
```
121-
122-
This file must be a CommonJS module that exports an array of implementations:
115+
To test implementations with endpoints running locally, create a configuration file named
116+
`localConfig.cjs` in the root directory of the test suite. `localConfig.cjs` should export
117+
a json object. Add the property `implementations` to the exported object. `implementations`
118+
should be an array of objects such as the one below:
123119

124120
```js
125-
// file .localImplementationsConfig.cjs
126-
module.exports = [{
127-
"name": "My Company",
128-
"implementation": "My Implementation Name",
129-
"issuers": [{
130-
"id": "urn:uuid:my:implementation:issuer:id",
131-
"endpoint": "https://localhost:40443/issuers/foo/credentials/issue",
132-
"tags": ["vc-api", "localhost"]
133-
}],
134-
"verifiers": [{
135-
"id": "https://localhost:40443/verifiers/z19uokPn3b1Z4XDbQSHo7VhFR",
136-
"endpoint": "https://localhost:40443/verifiers/z19uokPn3b1Z4XDbQSHo7VhFR/credentials/verify",
137-
"tags": ["vc-api", "localhost"]
138-
}]
139-
}];
121+
// localConfig.cjs defining local implementations
122+
module.exports = {
123+
"implementations": [{
124+
"name": "My Company",
125+
"implementation": "My Implementation Name",
126+
"issuers": [{
127+
"id": "urn:uuid:my:implementation:issuer:id",
128+
"endpoint": "https://localhost:40443/issuers/foo/credentials/issue",
129+
"tags": ["eddsa-rdfc-2022"]
130+
}],
131+
"verifiers": [{
132+
"id": "https://localhost:40443/verifiers/z19uokPn3b1Z4XDbQSHo7VhFR",
133+
"endpoint": "https://localhost:40443/verifiers/z19uokPn3b1Z4XDbQSHo7VhFR/credentials/verify",
134+
"tags": ["eddsa-rdfc-2022"]
135+
}]
136+
}];
137+
};
140138
```
141139

142-
To run the tests only against the localhost implementation, update the test
143-
suite to filter implementations using the specified tag in your config file.
144-
145-
For instance, if your `.localImplementationsConfig.cjs` looks like above
146-
in the `vc-api-issuer-test-suite`, you can adjust the
147-
[tag](https://github.com/w3c-ccg/vc-api-issuer-test-suite/blob/main/tests/10-issuer.js#L14)
148-
to filter the implementation by `localhost` rather than `vc-api` and
149-
then run the tests.
140+
After adding the config file, only implementations in `localConfig.cjs` will run.
150141

151142
### Tags
152143

0 commit comments

Comments
 (0)