refactor: Enable stricter test linting

This commit is contained in:
Joachim Van Herwegen
2023-10-27 15:53:52 +02:00
parent 6248ed0938
commit 7a007dc466
48 changed files with 179 additions and 155 deletions

View File

@@ -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> => {

View File

@@ -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);
});

View File

@@ -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);
});

View File

@@ -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 });

View File

@@ -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);
});