Skip to content

Commit 8e38329

Browse files
Create paramsTest.ts
1 parent a2d0a78 commit 8e38329

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

paramsTest.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { generateStaticParams as chapterParams } from '@/app/writers/[writer]/novels/[novel]/[chapter]/page'
2+
import { generateStaticParams as novelParams } from '@/app/writers/[writer]/novels/[novel]/page'
3+
import { generateStaticParams as writerParams } from '@/app/writers/[writer]/page'
4+
5+
import logger from '@/library/logger'
6+
7+
async function logParams<T>(name: string, paramsFunction: () => Promise<T[]>) {
8+
const staticParams = await paramsFunction()
9+
logger.info(name, staticParams)
10+
}
11+
12+
async function runTests() {
13+
await logParams('Novel params', novelParams)
14+
await logParams('Chapter params', chapterParams)
15+
await logParams('Writer params', writerParams)
16+
}
17+
18+
runTests().catch((error) => {
19+
logger.error('Error while logging static params:', error)
20+
})
21+
22+
/*
23+
pnpm tsx paramsTest
24+
*/

0 commit comments

Comments
 (0)