UNPKG

@solid-data-modules/rdflib-utils

Version:

Utility functions for the development of Solid Data Modules for RDFLib.js

31 lines (30 loc) 1.35 kB
/// <reference types="jest" /> /** * Mock a turtle document at the given URL * @param fetch - A mocked fetch function * @param url - The URL to mock * @param ttl - The mocked turtle file content * @param additionalHeaders - Additional headers to include in the response */ export declare function mockTurtleDocument(fetch: jest.Mock, url: string, ttl: string, additionalHeaders?: Record<string, string>): void; /** * Mock a LDP container at the given URL * @param fetch - A mocked fetch function * @param url - The URL to mock * @param contains - List of URLs of documents contained in this container * @param moreTurtle - Additional turtle to include into the response * @param additionalHeaders - Additional headers to include in the response */ export declare function mockLdpContainer(fetch: jest.Mock, url: string, contains?: string[], moreTurtle?: string, additionalHeaders?: Record<string, string>): void; /** * Mock a 404 - Not Found response for the given URL * @param fetch - A mocked fetch function * @param url - The URL to mock */ export declare function mockNotFound(fetch: jest.Mock, url: string): void; /** * Mock a 403 - Forbidden response for the given URL * @param fetch - A mocked fetch function * @param url - The URL to mock */ export declare function mockForbidden(fetch: jest.Mock, url: string): void;