From 77ed703554d815d4bb841e3729b2171d3cd26af8 Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Wed, 22 May 2024 10:17:22 -0400 Subject: [PATCH] Fix prettier issues --- tests/cli.test.ts | 1 - tests/mocks/generator.ts | 24 ++++++++++--------- tests/sitemap-utils.test.ts | 48 +++++++++++++------------------------ tests/util.ts | 4 ++-- 4 files changed, 31 insertions(+), 46 deletions(-) diff --git a/tests/cli.test.ts b/tests/cli.test.ts index ba1d0355..c01382c8 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -8,7 +8,6 @@ import normalizedSample from './mocks/sampleconfig.normalized.json'; const exec = util.promisify(execCb); const execFileSync = execFileSyncCb; - let hasXMLLint = true; try { execFileSync('which', ['xmllint']); diff --git a/tests/mocks/generator.ts b/tests/mocks/generator.ts index 6cb5050d..1a147342 100644 --- a/tests/mocks/generator.ts +++ b/tests/mocks/generator.ts @@ -1,14 +1,16 @@ export function el(tagName: string, content: string = simpleText): string { - return `<${tagName}>${content}` + return `<${tagName}>${content}`; } -export const simpleText = 'Example text&><\'"&><\'"' -export const simpleTextEscaped = 'Example text&><\'"&><\'"' -export const simpleURL = 'https://example.com/path?some=value&another#!fragment' -export const simpleURLEscaped = 'https://example.com/path?some=value&another#!fragment' -export const integer = 1 -export const float = 0.99 -export const date = '2011-06-27T00:00:00.000Z' -export const escapable = "&><'\"" -export const attrEscaped='&><'"' -export const textEscaped='&><\'"' +export const simpleText = 'Example text&><\'"&><\'"'; +export const simpleTextEscaped = 'Example text&><\'"&><\'"'; +export const simpleURL = + 'https://example.com/path?some=value&another#!fragment'; +export const simpleURLEscaped = + 'https://example.com/path?some=value&another#!fragment'; +export const integer = 1; +export const float = 0.99; +export const date = '2011-06-27T00:00:00.000Z'; +export const escapable = '&><\'"'; +export const attrEscaped = '&><'"'; +export const textEscaped = '&><\'"'; diff --git a/tests/sitemap-utils.test.ts b/tests/sitemap-utils.test.ts index 72662bd9..85133f71 100644 --- a/tests/sitemap-utils.test.ts +++ b/tests/sitemap-utils.test.ts @@ -167,8 +167,7 @@ describe('utils', () => { beforeEach(() => { testvideo = { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { id: 'http://example.com/url', @@ -240,8 +239,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -268,8 +266,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -296,8 +293,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: @@ -324,8 +320,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -351,8 +346,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -377,8 +371,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -404,8 +397,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -432,8 +424,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -459,8 +450,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -486,8 +476,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -512,8 +501,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -539,8 +527,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -567,8 +554,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -594,8 +580,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", @@ -621,8 +606,7 @@ describe('utils', () => { validateSMIOptions( { ...itemTemplate, - url: - 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', + url: 'https://roosterteeth.com/episode/achievement-hunter-achievement-hunter-burnout-paradise-millionaires-club', video: [ { title: "2008:E2 - Burnout Paradise: Millionaire's Club", diff --git a/tests/util.ts b/tests/util.ts index 14613b1a..a63a5f82 100644 --- a/tests/util.ts +++ b/tests/util.ts @@ -10,7 +10,7 @@ export function truncateSync(file: string): fs.Stats { return stat; } -export function createCache(): { cacheFile: string, stat: fs.Stats } { +export function createCache(): { cacheFile: string; stat: fs.Stats } { const stat = truncateSync(CACHE_FILE); return { cacheFile: CACHE_FILE, @@ -20,4 +20,4 @@ export function createCache(): { cacheFile: string, stat: fs.Stats } { export function unlinkCache(): void { fs.unlinkSync(CACHE_FILE); -} \ No newline at end of file +}