Skip to content

Commit

Permalink
Fix prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
huntharo committed May 23, 2024
1 parent 42271d1 commit 77ed703
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 46 deletions.
1 change: 0 additions & 1 deletion tests/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
24 changes: 13 additions & 11 deletions tests/mocks/generator.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
export function el(tagName: string, content: string = simpleText): string {
return `<${tagName}>${content}</${tagName}>`
return `<${tagName}>${content}</${tagName}>`;
}

export const simpleText = 'Example text&><\'"&><\'"'
export const simpleTextEscaped = 'Example text&amp;>&lt;\'"&amp;>&lt;\'"'
export const simpleURL = 'https://example.com/path?some=value&another#!fragment'
export const simpleURLEscaped = 'https://example.com/path?some=value&amp;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='&amp;>&lt;&apos;&quot;'
export const textEscaped='&amp;>&lt;\'"'
export const simpleText = 'Example text&><\'"&><\'"';
export const simpleTextEscaped = 'Example text&amp;>&lt;\'"&amp;>&lt;\'"';
export const simpleURL =
'https://example.com/path?some=value&another#!fragment';
export const simpleURLEscaped =
'https://example.com/path?some=value&amp;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 = '&amp;>&lt;&apos;&quot;';
export const textEscaped = '&amp;>&lt;\'"';
48 changes: 16 additions & 32 deletions tests/sitemap-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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:
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -20,4 +20,4 @@ export function createCache(): { cacheFile: string, stat: fs.Stats } {

export function unlinkCache(): void {
fs.unlinkSync(CACHE_FILE);
}
}

0 comments on commit 77ed703

Please sign in to comment.