Skip to content

Commit feccdf1

Browse files
committed
Add unit tests for route handler
1 parent 612f09f commit feccdf1

File tree

7 files changed

+602
-0
lines changed

7 files changed

+602
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lnRb3bjsx2nspyrLXPfpa
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"version": 4,
3+
"routes": {
4+
"/middleware-rewrite-with-isr-destination": {
5+
"initialRevalidateSeconds": 10,
6+
"srcRoute": null,
7+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/middleware-rewrite-with-isr-destination.json"
8+
},
9+
"/isr": {
10+
"initialRevalidateSeconds": 10,
11+
"srcRoute": null,
12+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/isr.json"
13+
},
14+
"/ssg-preview/hello": {
15+
"initialRevalidateSeconds": false,
16+
"srcRoute": "/ssg-preview/[id]",
17+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-preview/hello.json"
18+
},
19+
"/ssg-preview/world": {
20+
"initialRevalidateSeconds": false,
21+
"srcRoute": "/ssg-preview/[id]",
22+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-preview/world.json"
23+
},
24+
"/ssg": {
25+
"initialRevalidateSeconds": false,
26+
"srcRoute": null,
27+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg.json"
28+
},
29+
"/ssg-dynamic/1": {
30+
"initialRevalidateSeconds": false,
31+
"srcRoute": "/ssg-dynamic/[id]",
32+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-dynamic/1.json"
33+
}
34+
},
35+
"dynamicRoutes": {
36+
"/ssg-dynamic-fallback/[id]": {
37+
"routeRegex": "^/ssg\\-dynamic\\-fallback/([^/]+?)(?:/)?$",
38+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-dynamic-fallback/[id].json",
39+
"fallback": "/ssg-dynamic-fallback/[id].html",
40+
"dataRouteRegex": "^/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg\\-dynamic\\-fallback/([^/]+?)\\.json$"
41+
},
42+
"/ssg-preview/[id]": {
43+
"routeRegex": "^/ssg\\-preview/([^/]+?)(?:/)?$",
44+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-preview/[id].json",
45+
"fallback": false,
46+
"dataRouteRegex": "^/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg\\-preview/([^/]+?)\\.json$"
47+
},
48+
"/ssg-dynamic/[id]": {
49+
"routeRegex": "^/ssg\\-dynamic/([^/]+?)(?:/)?$",
50+
"dataRoute": "/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg-dynamic/[id].json",
51+
"fallback": false,
52+
"dataRouteRegex": "^/_next/data/lnRb3bjsx2nspyrLXPfpa/ssg\\-dynamic/([^/]+?)\\.json$"
53+
}
54+
},
55+
"notFoundRoutes": [],
56+
"preview": {
57+
"previewModeId": "a4f0a4586498ab90ef6af5c106920f7e",
58+
"previewModeSigningKey": "61c53747d3c40a6a1e809ecae2a7c625643701bb390321f6c57813e7a78363d9",
59+
"previewModeEncryptionKey": "d9108ce7f77f85f1f07ea2fc9e7355805cf11ddd28c85f1a61cfce1810515a60"
60+
}
61+
}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"version": 1,
3+
"config": {
4+
"env": {},
5+
"webpack": null,
6+
"eslint": { "ignoreDuringBuilds": true },
7+
"typescript": {
8+
"ignoreBuildErrors": false,
9+
"tsconfigPath": "tsconfig.json"
10+
},
11+
"distDir": ".next",
12+
"cleanDistDir": true,
13+
"assetPrefix": "",
14+
"configOrigin": "next.config.js",
15+
"useFileSystemPublicRoutes": true,
16+
"generateEtags": true,
17+
"pageExtensions": ["tsx", "ts", "jsx", "js"],
18+
"poweredByHeader": true,
19+
"compress": true,
20+
"analyticsId": "",
21+
"images": {
22+
"deviceSizes": [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
23+
"imageSizes": [16, 32, 48, 64, 96, 128, 256, 384],
24+
"path": "/_next/image",
25+
"loader": "default",
26+
"loaderFile": "",
27+
"domains": [],
28+
"disableStaticImages": false,
29+
"minimumCacheTTL": 60,
30+
"formats": ["image/webp"],
31+
"dangerouslyAllowSVG": false,
32+
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
33+
"contentDispositionType": "inline",
34+
"remotePatterns": [{ "hostname": "**.unsplash.com" }],
35+
"unoptimized": false
36+
},
37+
"devIndicators": {
38+
"buildActivity": true,
39+
"buildActivityPosition": "bottom-right"
40+
},
41+
"onDemandEntries": { "maxInactiveAge": 60000, "pagesBufferLength": 5 },
42+
"amp": { "canonicalBase": "" },
43+
"basePath": "",
44+
"sassOptions": {},
45+
"trailingSlash": false,
46+
"i18n": null,
47+
"productionBrowserSourceMaps": false,
48+
"optimizeFonts": true,
49+
"excludeDefaultMomentLocales": true,
50+
"serverRuntimeConfig": {},
51+
"publicRuntimeConfig": {},
52+
"reactProductionProfiling": false,
53+
"reactStrictMode": true,
54+
"httpAgentOptions": { "keepAlive": true },
55+
"outputFileTracing": true,
56+
"staticPageGenerationTimeout": 60,
57+
"swcMinify": true,
58+
"output": "standalone",
59+
"modularizeImports": {
60+
"@mui/icons-material": { "transform": "@mui/icons-material/{{member}}" },
61+
"date-fns": { "transform": "date-fns/{{member}}" },
62+
"lodash": { "transform": "lodash/{{member}}" },
63+
"lodash-es": { "transform": "lodash-es/{{member}}" },
64+
"ramda": { "transform": "ramda/es/{{member}}" },
65+
"react-bootstrap": { "transform": "react-bootstrap/{{member}}" },
66+
"antd": { "transform": "antd/lib/{{kebabCase member}}" },
67+
"ahooks": { "transform": "ahooks/es/{{member}}" },
68+
"@ant-design/icons": {
69+
"transform": "@ant-design/icons/lib/icons/{{member}}"
70+
}
71+
},
72+
"experimental": {
73+
"serverMinification": false,
74+
"serverSourceMaps": false,
75+
"caseSensitiveRoutes": false,
76+
"useDeploymentId": false,
77+
"useDeploymentIdServerActions": false,
78+
"clientRouterFilter": true,
79+
"clientRouterFilterRedirects": false,
80+
"fetchCacheKeyPrefix": "",
81+
"middlewarePrefetch": "flexible",
82+
"optimisticClientCache": true,
83+
"manualClientBasePath": false,
84+
"legacyBrowsers": false,
85+
"newNextLinkBehavior": true,
86+
"cpus": 7,
87+
"memoryBasedWorkersCount": false,
88+
"sharedPool": true,
89+
"isrFlushToDisk": true,
90+
"workerThreads": false,
91+
"pageEnv": false,
92+
"optimizeCss": false,
93+
"nextScriptWorkers": false,
94+
"scrollRestoration": false,
95+
"externalDir": false,
96+
"disableOptimizedLoading": false,
97+
"gzipSize": true,
98+
"swcFileReading": true,
99+
"craCompat": false,
100+
"esmExternals": true,
101+
"appDir": true,
102+
"isrMemoryCacheSize": 52428800,
103+
"fullySpecified": false,
104+
"outputFileTracingRoot": "/Users/socsieng/Projects/opennextjs-aws",
105+
"swcTraceProfiling": false,
106+
"forceSwcTransforms": false,
107+
"largePageDataBytes": 128000,
108+
"adjustFontFallbacks": false,
109+
"adjustFontFallbacksWithSizeAdjust": false,
110+
"typedRoutes": false,
111+
"instrumentationHook": false,
112+
"trustHostHeader": false
113+
},
114+
"configFileName": "next.config.js"
115+
},
116+
"appDir": "/Users/socsieng/Projects/opennextjs-aws/example",
117+
"relativeAppDir": "example",
118+
"files": [
119+
".next/routes-manifest.json",
120+
".next/server/pages-manifest.json",
121+
".next/build-manifest.json",
122+
".next/prerender-manifest.json",
123+
".next/server/middleware-manifest.json",
124+
".next/server/middleware-build-manifest.js",
125+
".next/server/middleware-react-loadable-manifest.js",
126+
".next/react-loadable-manifest.json",
127+
".next/server/font-manifest.json",
128+
".next/BUILD_ID",
129+
".next/server/next-font-manifest.js",
130+
".next/server/next-font-manifest.json"
131+
],
132+
"ignore": [
133+
"../node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*"
134+
]
135+
}

0 commit comments

Comments
 (0)