mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
chore: Update dependencies
This commit is contained in:
@@ -30,7 +30,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
let writer: AllowAcceptHeaderWriter;
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
response = createResponse();
|
||||
response = createResponse() as HttpResponse;
|
||||
|
||||
writer = new AllowAcceptHeaderWriter(
|
||||
[ 'OPTIONS', 'GET', 'HEAD', 'PUT', 'POST', 'PATCH', 'DELETE' ],
|
||||
@@ -42,7 +42,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: document })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'OPTIONS', 'GET', 'HEAD', 'PUT', 'PATCH', 'DELETE' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-put']).toBe('*/*');
|
||||
@@ -53,7 +53,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: emptyContainer })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'OPTIONS', 'GET', 'HEAD', 'POST', 'PATCH', 'DELETE' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-post']).toBe('*/*');
|
||||
@@ -63,7 +63,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: fullContainer })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'OPTIONS', 'GET', 'HEAD', 'POST', 'PATCH' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-post']).toBe('*/*');
|
||||
@@ -73,7 +73,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: storageContainer })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'OPTIONS', 'GET', 'HEAD', 'POST', 'PATCH' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-post']).toBe('*/*');
|
||||
@@ -83,7 +83,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: error404 })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'PUT', 'PATCH' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-put']).toBe('*/*');
|
||||
@@ -94,7 +94,7 @@ describe('An AllowAcceptHeaderWriter', (): void => {
|
||||
await expect(writer.handleSafe({ response, metadata: error405 })).resolves.toBeUndefined();
|
||||
const headers = response.getHeaders();
|
||||
expect(typeof headers.allow).toBe('string');
|
||||
expect(new Set((headers.allow as string).split(', ')))
|
||||
expect(new Set(headers.allow!.split(', ')))
|
||||
.toEqual(new Set([ 'OPTIONS', 'GET', 'HEAD', 'POST', 'PATCH', 'DELETE' ]));
|
||||
expect(headers['accept-patch']).toBe('text/n3, application/sparql-update');
|
||||
expect(headers['accept-put']).toBeUndefined();
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('RangeMetadataWriter', (): void => {
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
metadata = new RepresentationMetadata();
|
||||
response = createResponse();
|
||||
response = createResponse() as HttpResponse;
|
||||
writer = new RangeMetadataWriter();
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { RepresentationMetadata } from '../../../../../../src/http/representatio
|
||||
import { OwnerMetadataWriter } from '../../../../../../src/identity/interaction/pod/util/OwnerMetadataWriter';
|
||||
import { PodStore } from '../../../../../../src/identity/interaction/pod/util/PodStore';
|
||||
import type { StorageLocationStrategy } from '../../../../../../src/server/description/StorageLocationStrategy';
|
||||
import type { HttpResponse } from '../../../../../../src/server/HttpResponse';
|
||||
import { joinUrl } from '../../../../../../src/util/PathUtil';
|
||||
|
||||
describe('An OwnerMetadataWriter', (): void => {
|
||||
@@ -20,7 +21,7 @@ describe('An OwnerMetadataWriter', (): void => {
|
||||
beforeEach(async(): Promise<void> => {
|
||||
metadata = new RepresentationMetadata(target);
|
||||
|
||||
response = createResponse();
|
||||
response = createResponse() as HttpResponse;
|
||||
|
||||
podStore = {
|
||||
findByBaseUrl: jest.fn().mockResolvedValue({ id, accountId }),
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('A HandlerServerConfigurator', (): void => {
|
||||
writeHead: jest.fn(),
|
||||
} as any;
|
||||
response.end.mockImplementation((): any => {
|
||||
response.headersSent = true;
|
||||
(response as any).headersSent = true;
|
||||
});
|
||||
response.writeHead.mockReturnValue(response);
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('A HandlerServerConfigurator', (): void => {
|
||||
|
||||
handler = {
|
||||
handleSafe: jest.fn((): void => {
|
||||
response.headersSent = true;
|
||||
(response as any).headersSent = true;
|
||||
}),
|
||||
} as any;
|
||||
|
||||
@@ -89,7 +89,7 @@ describe('A HandlerServerConfigurator', (): void => {
|
||||
});
|
||||
|
||||
it('does not write an error if the response had been started.', async(): Promise<void> => {
|
||||
response.headersSent = true;
|
||||
(response as any).headersSent = true;
|
||||
handler.handleSafe.mockRejectedValueOnce(new Error('dummyError'));
|
||||
server.emit('request', request, response);
|
||||
await flushPromises();
|
||||
|
||||
Reference in New Issue
Block a user