@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
34 lines • 1.24 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Implementation of a resolver for testing.
* @class
* @implements Resolver
*/
class TestResolver {
/**
* Prepares the resolver for the test run.
* @param identifier to use for the test.
* @param identifierDocument to use for the test.
*/
prepareTest(identifier, identifierDocument) {
this.identifier = identifier;
this.identifierDocument = identifierDocument;
}
/**
* Sends a fetch request to the resolver URL including the
* specified identifier.
*/
async resolve(identifier) {
if (this.identifier.id === identifier.id) {
return this.identifierDocument;
}
throw new Error('Not found');
}
}
exports.default = TestResolver;
//# sourceMappingURL=TestResolver.js.map