Skip to content

Commit 7b947dc

Browse files
committed
test: add notFound cases for 404 with getStaticProps without revalidate
1 parent c1712f8 commit 7b947dc

File tree

1 file changed

+12
-0
lines changed
  • tests/fixtures/page-router-base-path-i18n/pages/products

1 file changed

+12
-0
lines changed

tests/fixtures/page-router-base-path-i18n/pages/products/[slug].js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ const Product = ({ time, slug }) => (
88
</div>
99
)
1010

11+
/** @type {import('next').GetStaticProps} */
1112
export async function getStaticProps({ params }) {
13+
if (params.slug === 'not-found-no-revalidate') {
14+
return {
15+
notFound: true,
16+
}
17+
} else if (params.slug === 'not-found-with-revalidate') {
18+
return {
19+
notFound: true,
20+
revalidate: 600,
21+
}
22+
}
23+
1224
return {
1325
props: {
1426
time: new Date().toISOString(),

0 commit comments

Comments
 (0)