mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Enable stricter test linting
This commit is contained in:
@@ -114,7 +114,7 @@ describe('A ConstantConverter', (): void => {
|
||||
expect(createReadStream).toHaveBeenCalledWith('abc/def/index.html', 'utf8');
|
||||
|
||||
expect(converted.metadata.contentType).toBe('text/html');
|
||||
expect(await arrayifyStream(converted.data)).toEqual([ 'file contents' ]);
|
||||
await expect(arrayifyStream(converted.data)).resolves.toEqual([ 'file contents' ]);
|
||||
});
|
||||
|
||||
it('defaults to the most permissive options.', async(): Promise<void> => {
|
||||
|
||||
@@ -16,7 +16,7 @@ describe('A ContainerToTemplateConverter', (): void => {
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
templateEngine = {
|
||||
handleSafe: jest.fn().mockReturnValue(Promise.resolve('<html>')),
|
||||
handleSafe: jest.fn().mockResolvedValue('<html>'),
|
||||
} as any;
|
||||
converter = new ContainerToTemplateConverter(templateEngine, 'text/html', identifierStrategy);
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('A DynamicJsonToTemplateConverter', (): void => {
|
||||
input = { identifier, representation, preferences };
|
||||
|
||||
templateEngine = {
|
||||
handleSafe: jest.fn().mockReturnValue(Promise.resolve('<html>')),
|
||||
handleSafe: jest.fn().mockResolvedValue('<html>'),
|
||||
} as any;
|
||||
converter = new DynamicJsonToTemplateConverter(templateEngine);
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('An ErrorToTemplateConverter', (): void => {
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
templateEngine = {
|
||||
handleSafe: jest.fn().mockReturnValue(Promise.resolve('<html>')),
|
||||
handleSafe: jest.fn().mockResolvedValue('<html>'),
|
||||
} as any;
|
||||
converter = new ErrorToTemplateConverter(templateEngine,
|
||||
{ mainTemplatePath, codeTemplatesPath, extension, contentType });
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('A MarkdownToHtmlConverter', (): void => {
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
templateEngine = {
|
||||
handleSafe: jest.fn().mockReturnValue(Promise.resolve('<html>')),
|
||||
handleSafe: jest.fn().mockResolvedValue('<html>'),
|
||||
} as any;
|
||||
converter = new MarkdownToHtmlConverter(templateEngine);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user