Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn committed Jan 17, 2024
1 parent 3c63ba5 commit 4f807da
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions codemods/next/13/app-directory-boilerplate/test/test.win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,44 @@ describe('next 13 app-directory-boilerplate', () => {
);

ok(
externalFileCommands.some(
(command) => command.path.endsWith('project\\app\\layout.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\layout.tsx'),
),
);

ok(
externalFileCommands.some(
(command) => command.path.endsWith('project\\app\\error.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\error.tsx'),
),
);

ok(
externalFileCommands.some(
(command) => command.path.endsWith('project\\app\\not-found.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\not-found.tsx'),
),
);

ok(
externalFileCommands.some(
(command) => command.path.endsWith('project\\app\\page.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\page.tsx'),
),
);

ok(
externalFileCommands.some(
(command) =>
command.path.endsWith('project\\app\\[a]\\[b]\\page.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\[a]\\[b]\\page.tsx'),
),
);

ok(
externalFileCommands.some(
(command) =>
command.path.endsWith('project\\app\\[a]\\c\\page.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\[a]\\c\\page.tsx'),
),
);

ok(
externalFileCommands.some(
(command) => command.path.endsWith('project\\app\\a\\page.tsx'),
externalFileCommands.some((command) =>
command.path.endsWith('project\\app\\a\\page.tsx'),
),
);

Expand All @@ -163,19 +161,20 @@ describe('next 13 app-directory-boilerplate', () => {
command.kind === 'upsertFile' &&
command.path.endsWith('project\\app\\components.tsx') &&
command.data
.replace(/\/\/ This file has been sourced from.*\n/g, '')
.replace(/\W/gm, '')

===
.replace(
/\/\/ This file has been sourced from.*\n/g,
'',
)
.replace(/\W/gm, '') ===
`
'use client';
export default function Index({}) {
return null;
}
;`.replace(/\W/gm, '')
);
}),
);
}),
);

ok(
Expand All @@ -184,8 +183,11 @@ describe('next 13 app-directory-boilerplate', () => {
command.kind === 'upsertFile' &&
command.path.endsWith('project\\app\\[a]\\c\\page.tsx') &&
command.data
.replace(/\/\/ This file has been sourced from.*\n/g, '')
.replace(/\W/gm, '') ===
.replace(
/\/\/ This file has been sourced from.*\n/g,
'',
)
.replace(/\W/gm, '') ===
`
import Components from "./components";
// TODO reimplement getServerSideProps with custom logic
Expand All @@ -203,10 +205,15 @@ describe('next 13 app-directory-boilerplate', () => {
externalFileCommands.some((command) => {
return (
command.kind === 'upsertFile' &&
command.path.endsWith('project\\app\\[a]\\[b]\\components.tsx') &&
command.path.endsWith(
'project\\app\\[a]\\[b]\\components.tsx',
) &&
command.data
.replace(/\/\/ This file has been sourced from.*\n/g, '')
.replace(/\W/gm, '') ===
.replace(
/\/\/ This file has been sourced from.*\n/g,
'',
)
.replace(/\W/gm, '') ===
`
'use client';
`.replace(/\W/gm, '')
Expand Down

0 comments on commit 4f807da

Please sign in to comment.