Skip to content

Commit

Permalink
Add local config instructions to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jan 26, 2024
1 parent b1b05cc commit d787736
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [Testing Locally](#testing-locally)
- [Implementation](#implementation)
- [Docker Integration (TODO)](#docker-integration-todo)
- [Contribute](#contribute)
Expand All @@ -29,6 +30,45 @@ npm i
npm test
```

### Testing Locally

If you want to test your implementations for endpoints running locally, you can
create a configuration file `.localImplementationsConfig.cjs` in the root
directory of the test suite.

This file must be a CommonJS module that exports an array of implementations:

```js
// .localImplementationsConfig.cjs defining local implementations
// you can specify a BASE_URL before running the tests such as:
// BASE_URL=http://localhost:40443/zDdfsdfs npm test
const baseURL = process.env.BASE_URL || 'https://localhost:40443/id'
module.exports = [{
"name": "My Company",
"implementation": "My Implementation Name",
"issuers": [{
"id": "did:myMethod:implementation:issuer:id",
"endpoint": `${baseUrl}/credentials/issue`,
"tags": ["eddsa-rdfc-2022", "localhost"]
}],
"verifiers": [{
"id": "did:myMethod:implementation:verifier:id",
"endpoint": `${baseURL}/credentials/verify`,
"tags": ["eddsa-rdfc-2022", "localhost"]
}]
}];
```

After adding the config file, both the localhost implementations and other
non-localhost implementations will be included in the test run.

To specifically test only the localhost implementation, modify the test suite to
filter implementations based on a specific tag in your local configuration file.

For instance, if your `.localImplementationsConfig.cjs` config file looks like
above in the `di-eddsa-2022-test-suite`, you can adjust the tag used in each test
file of the test suite to filter the implementations by `localhost` instead of `eddsa-rdfc-2022`.

## Implementation

You will need an issuer and verifier that are compatible with [VC API](https://w3c-ccg.github.io/vc-api/)
Expand Down

0 comments on commit d787736

Please sign in to comment.