@inrupt/solid-client / acp/mock

Module: acp/mock

Table of contents

Functions

addMockAcrTo

addMockAcrTo<T>(resource, accessControlResource?): T & WithAccessibleAcr

Warning

Do not use this function in production code. For use in unit tests that require a Resource with an AccessControlResource.

Attaches an Access Control Resource to a given SolidDataset for use in unit tests; e.g., unit tests that call getPolicyUrlAll.

since 1.6.0

Type parameters

Name

Type

T

extends WithResourceInfo

Parameters

Name

Type

Description

resource

T

The Resource to mock up with a new resource ACL.

accessControlResource

AccessControlResource

The Access Control Resource to attach to the given Resource.

Returns

T & WithAccessibleAcr

The input Resource with an empty resource ACL attached.


mockAcrFor

mockAcrFor(resourceUrl): AccessControlResource

Warning

Do not use this function in production code. For use in unit tests that require a AccessControlResource.

Initialises a new empty Access Control Resource for a given Resource for use in unit tests.

since 1.6.0

Parameters

Name

Type

Description

resourceUrl

UrlString

The URL of the Resource to which the mocked ACR should apply.

Returns

AccessControlResource

The mocked empty Access Control Resource for the given Resource.