@inrupt/solid-client / acp/mock
Module: acp/mock¶
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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Resource to mock up with a new resource ACL. |
|
The Access Control Resource to attach to the given Resource. |
Returns¶
The input Resource with an empty resource ACL attached.
Defined in¶
src/acp/mock.ts:67
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 |
---|---|---|
|
|
The URL of the Resource to which the mocked ACR should apply. |
Returns¶
The mocked empty Access Control Resource for the given Resource.
Defined in¶
src/acp/mock.ts:43