From 33c48e1bbad2b708a51aa209a0479e54f1915773 Mon Sep 17 00:00:00 2001 From: Julian Cataldo Date: Sun, 4 Aug 2024 20:56:18 +0200 Subject: [PATCH] test: integration tests for 404 and error pages, static and server --- .../dist_expected/server/chunk/404.js | 15 ++++ .../dist_expected/server/chunk/throws.js | 13 +++ .../dist_expected/server/entrypoint.js | 28 +++++++ .../server-express/src/routes/404.ts | 14 ++++ .../src/routes/_404_dev_expected._html | 77 ++++++++++++++++++ .../src/routes/_404_prod_expected._html | 81 +++++++++++++++++++ .../src/routes/_throws_dev_expected._html | 62 ++++++++++++++ .../src/routes/_throws_prod_expected._html | 60 ++++++++++++++ .../server-express/src/routes/throws.ts | 17 ++++ .../00-routes/00-basic/index.html | 2 +- .../00-routes/01-param/jupiter/index.html | 2 +- .../00-routes/01-param/omega/index.html | 2 +- .../car/bike/boat/fog/index.html | 2 +- .../05-torture-test/car/bike/boat/index.html | 2 +- .../car/bike/boat/rain/index.html | 2 +- .../car/bike/boat/train/index.html | 2 +- .../car/bike/boat/train/red/index.html | 2 +- .../car/bike/boat/zeppelin/index.html | 2 +- .../05-torture-test/creation-mars/index.html | 2 +- .../05-torture-test/creation-noon/index.html | 2 +- .../05-torture-test/creation/index.html | 2 +- .../05-torture-test/dance-mars/index.html | 2 +- .../05-torture-test/dance-noon/index.html | 2 +- .../05-torture-test/dance/index.html | 2 +- .../edge-noon-plumber/index.html | 2 +- .../05-torture-test/formal/guide/index.html | 2 +- .../05-torture-test/formal/index.html | 2 +- .../formal/research/index.html | 2 +- .../05-torture-test/hollow-noon/index.html | 2 +- .../00-routes/05-torture-test/index.html | 2 +- .../05-torture-test/make/best/index.html | 2 +- .../05-torture-test/make/done/index.html | 2 +- .../05-torture-test/month-noon/index.html | 2 +- .../05-torture-test/popular/brave/index.html | 2 +- .../05-torture-test/popular/index.html | 2 +- .../popular/research/index.html | 2 +- .../05-torture-test/popular/yearn/index.html | 2 +- .../05-torture-test/shoot-or/index.html | 2 +- .../05-torture-test/year-noon/index.html | 2 +- .../static-site/dist_expected/404.html | 16 ++++ .../static-site/dist_expected/index.html | 2 +- .../src/documents/document-minimal.ts | 4 +- .../routes/00-routes/_00-basic_expected.html | 2 +- .../00-routes/_01-param_expected-jupiter.html | 2 +- .../00-routes/_01-param_expected-omega.html | 2 +- .../static-site/src/routes/404.ts | 14 ++++ .../src/routes/_00-basic_expected.html | 17 ++++ .../static-site/src/routes/_404_expected.html | 15 ++++ .../src/routes/_does_not_exist_expected.html | 15 ++++ .../src/routes/_throws_expected.html | 62 ++++++++++++++ .../static-site/src/routes/throws.ts | 17 ++++ .../__fixtures__/static-site/vite.config.ts | 19 +++-- integration/manual-tests.sh | 1 + integration/src/addons/markdown.test.ts | 3 +- integration/src/addons/metadata.test.ts | 3 +- integration/src/addons/svg.test.ts | 3 +- integration/src/assets.test.ts | 10 ++- .../src/build-mode/project-core.test.ts | 4 +- integration/src/custom-elements.test.ts | 7 +- integration/src/polyfills.test.ts | 4 +- integration/src/routes.test.ts | 42 ++++++++-- .../02-runs-after-build.test.ts | 6 +- integration/src/server-express/_common.ts | 18 +++++ .../src/server-express/dev-all-around.test.ts | 4 +- local-ci.sh | 5 +- 65 files changed, 659 insertions(+), 65 deletions(-) create mode 100644 integration/__fixtures__/server-express/dist_expected/server/chunk/404.js create mode 100644 integration/__fixtures__/server-express/dist_expected/server/chunk/throws.js create mode 100644 integration/__fixtures__/server-express/src/routes/404.ts create mode 100644 integration/__fixtures__/server-express/src/routes/_404_dev_expected._html create mode 100644 integration/__fixtures__/server-express/src/routes/_404_prod_expected._html create mode 100644 integration/__fixtures__/server-express/src/routes/_throws_dev_expected._html create mode 100644 integration/__fixtures__/server-express/src/routes/_throws_prod_expected._html create mode 100644 integration/__fixtures__/server-express/src/routes/throws.ts create mode 100644 integration/__fixtures__/static-site/dist_expected/404.html create mode 100644 integration/__fixtures__/static-site/src/routes/404.ts create mode 100644 integration/__fixtures__/static-site/src/routes/_00-basic_expected.html create mode 100644 integration/__fixtures__/static-site/src/routes/_404_expected.html create mode 100644 integration/__fixtures__/static-site/src/routes/_does_not_exist_expected.html create mode 100644 integration/__fixtures__/static-site/src/routes/_throws_expected.html create mode 100644 integration/__fixtures__/static-site/src/routes/throws.ts diff --git a/integration/__fixtures__/server-express/dist_expected/server/chunk/404.js b/integration/__fixtures__/server-express/dist_expected/server/chunk/404.js new file mode 100644 index 0000000..2a159be --- /dev/null +++ b/integration/__fixtures__/server-express/dist_expected/server/chunk/404.js @@ -0,0 +1,15 @@ +import { defineRoute } from '@gracile/gracile/route'; +import { html } from '@gracile/gracile/server-html'; +import { d as document } from './document.js'; +import '@gracile/gracile/document'; + +const _404 = defineRoute({ + document: (context) => document({ ...context, title: "Gracile - 404" }), + template: (context) => html` +

⚠️ 404 !!

+ +

${context.url.toString()} not found.

+ ` +}); + +export { _404 as default }; diff --git a/integration/__fixtures__/server-express/dist_expected/server/chunk/throws.js b/integration/__fixtures__/server-express/dist_expected/server/chunk/throws.js new file mode 100644 index 0000000..3c2a7d8 --- /dev/null +++ b/integration/__fixtures__/server-express/dist_expected/server/chunk/throws.js @@ -0,0 +1,13 @@ +import { defineRoute } from '@gracile/gracile/route'; +import '@gracile/gracile/server-html'; +import { d as document } from './document.js'; +import '@gracile/gracile/document'; + +const throws = defineRoute({ + document: (context) => document({ ...context, title: "Gracile - Oh no" }), + template: (context) => { + throw new Error("!!! OH NO !!! I AM A FAKE ERROR !!!"); + } +}); + +export { throws as default }; diff --git a/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js b/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js index c93a59d..419cc02 100644 --- a/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js +++ b/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js @@ -14,6 +14,15 @@ const routes = new Map([ ] } ], + [ + "/404/", + { + "filePath": "src/routes/404.ts", + "pattern": {}, + "hasParams": false, + "pageAssets": [] + } + ], [ "/about/", { @@ -87,6 +96,15 @@ const routes = new Map([ "hasParams": false, "pageAssets": [] } + ], + [ + "/throws/", + { + "filePath": "src/routes/throws.ts", + "pattern": {}, + "hasParams": false, + "pageAssets": [] + } ] ]); routes.forEach((route, pattern) => { @@ -96,6 +114,7 @@ routes.forEach((route, pattern) => { const routeImports = new Map( [ ['/', () => import('./chunk/(home).js')], +['/404/', () => import('./chunk/404.js')], ['/about/', () => import('./chunk/about.js')], ['/api/basic/', () => import('./chunk/basic.js')], ['/api/:path*/', () => import('./chunk/_...path_.js')], @@ -104,10 +123,15 @@ const routeImports = new Map( ['/foo/bar/', () => import('./chunk/bar.js')], ['/private/', () => import('./chunk/index.js')], ['/redirect/', () => import('./chunk/redirect.js')], +['/throws/', () => import('./chunk/throws.js')], ] ); const routeAssets = new Map([ + [ + "/404.html", + "\t\n\n\t\n" + ], [ "/about/", "\t\n\n\t\n" @@ -143,6 +167,10 @@ const routeAssets = new Map([ [ "/redirect/", null + ], + [ + "/throws/", + "\t\n\n\t\n" ] ]); diff --git a/integration/__fixtures__/server-express/src/routes/404.ts b/integration/__fixtures__/server-express/src/routes/404.ts new file mode 100644 index 0000000..dedb27b --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/404.ts @@ -0,0 +1,14 @@ +import { defineRoute } from '@gracile/gracile/route'; +import { html } from '@gracile/gracile/server-html'; + +import { document } from '../document.js'; + +export default defineRoute({ + document: (context) => document({ ...context, title: 'Gracile - 404' }), + + template: (context) => html` +

⚠️ 404 !!

+ +

${context.url.toString()} not found.

+ `, +}); diff --git a/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html new file mode 100644 index 0000000..70236bf --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gracile - 404 + + + +

⚠️ 404 !!

+ +

http://localhost:9874/404/ not found.

+ + diff --git a/integration/__fixtures__/server-express/src/routes/_404_prod_expected._html b/integration/__fixtures__/server-express/src/routes/_404_prod_expected._html new file mode 100644 index 0000000..7109073 --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/_404_prod_expected._html @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gracile - 404 + + + +

⚠️ 404 !!

+ +

http://localhost:9874/404/ not found.

+ + diff --git a/integration/__fixtures__/server-express/src/routes/_throws_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_throws_dev_expected._html new file mode 100644 index 0000000..66399e7 --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/_throws_dev_expected._html @@ -0,0 +1,62 @@ + + + + + + + + + + + Error + + + + +
+

😵 An error has occurred!

+ + +
+ +
+Error: !!! OH NO !!! I AM A FAKE ERROR !!!
+    at RouteModule.template (__REPLACED_FOR_TESTS__/__fixtures__/server-express/src/routes/throws.ts:7:2)
+    at renderRouteTemplate (/Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/render/route-template.js:86:27)
+    at async middleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/request.js:136:26)
+    at async nodeMiddleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/node.js:19:24)
+ + + +
+
+ + + + diff --git a/integration/__fixtures__/server-express/src/routes/_throws_prod_expected._html b/integration/__fixtures__/server-express/src/routes/_throws_prod_expected._html new file mode 100644 index 0000000..ca9781b --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/_throws_prod_expected._html @@ -0,0 +1,60 @@ + + + + + + + + + Error + + + + +
+

😵 An error has occurred!

+ + +
+ +
+Error: !!! OH NO !!! I AM A FAKE ERROR !!!
+    at RouteModule.template (file://__REPLACED_FOR_TESTS__/__fixtures__/server-express/dist/server/chunk/throws.js:9:11)
+    at renderRouteTemplate (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/render/route-template.js:110:74)
+    at async middleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/request.js:136:26)
+    at async nodeMiddleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/node.js:19:24)
+ + + +
+
+ + + + diff --git a/integration/__fixtures__/server-express/src/routes/throws.ts b/integration/__fixtures__/server-express/src/routes/throws.ts new file mode 100644 index 0000000..90897d4 --- /dev/null +++ b/integration/__fixtures__/server-express/src/routes/throws.ts @@ -0,0 +1,17 @@ +import { defineRoute } from '@gracile/gracile/route'; +import { html } from '@gracile/gracile/server-html'; + +import { document } from '../document.js'; + +export default defineRoute({ + document: (context) => document({ ...context, title: 'Gracile - Oh no' }), + + template: (context) => { + throw new Error('!!! OH NO !!! I AM A FAKE ERROR !!!'); + html` +

⚠️ Arrrrrhh !!

+ +

${context.url.toString()} not found.

+ `; + }, +}); diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/00-basic/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/00-basic/index.html index d32c89c..b6b1e9c 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/00-basic/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/00-basic/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/jupiter/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/jupiter/index.html index ebeb711..a5ada74 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/jupiter/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/jupiter/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/omega/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/omega/index.html index fc7f7fe..102a109 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/omega/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/01-param/omega/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/fog/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/fog/index.html index 758474d..d932b71 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/fog/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/fog/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/index.html index 1fb3b6b..b0a752a 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/rain/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/rain/index.html index dea4f53..14aaefe 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/rain/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/rain/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/index.html index 474798f..9510605 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/red/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/red/index.html index ecff395..f609b46 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/red/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/train/red/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/zeppelin/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/zeppelin/index.html index 48e78d0..029709a 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/zeppelin/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/car/bike/boat/zeppelin/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-mars/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-mars/index.html index 00f3187..77ac0b9 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-mars/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-mars/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-noon/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-noon/index.html index e94a225..26e48ab 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-noon/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation-noon/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation/index.html index 7ab9a90..1eed1bb 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/creation/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-mars/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-mars/index.html index 018c79e..86e11ab 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-mars/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-mars/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-noon/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-noon/index.html index 75b1b90..82c4335 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-noon/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance-noon/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance/index.html index 4fa93f4..de8b543 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/dance/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/edge-noon-plumber/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/edge-noon-plumber/index.html index 3313d3c..d71adea 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/edge-noon-plumber/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/edge-noon-plumber/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/guide/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/guide/index.html index d9ae958..b171bcb 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/guide/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/guide/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/index.html index d233b4b..8088116 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/research/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/research/index.html index 1190018..19f5344 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/research/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/formal/research/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/hollow-noon/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/hollow-noon/index.html index 846a28a..caf3d17 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/hollow-noon/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/hollow-noon/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/index.html index 0744e98..de8d37a 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/best/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/best/index.html index 7fd4ea8..114adff 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/best/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/best/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/done/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/done/index.html index ee0e2f8..88b465f 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/done/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/make/done/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/month-noon/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/month-noon/index.html index 2c1b0f9..eb095b0 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/month-noon/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/month-noon/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/brave/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/brave/index.html index d0f66f5..d07405b 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/brave/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/brave/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/index.html index b870da6..90321c8 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/research/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/research/index.html index 6633a69..ed459e5 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/research/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/research/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/yearn/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/yearn/index.html index 84385a5..d06d517 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/yearn/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/popular/yearn/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/shoot-or/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/shoot-or/index.html index 83f3329..84afc61 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/shoot-or/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/shoot-or/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/year-noon/index.html b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/year-noon/index.html index 0b9b279..285ed6b 100644 --- a/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/year-noon/index.html +++ b/integration/__fixtures__/static-site/dist_expected/00-routes/05-torture-test/year-noon/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/dist_expected/404.html b/integration/__fixtures__/static-site/dist_expected/404.html new file mode 100644 index 0000000..86a1934 --- /dev/null +++ b/integration/__fixtures__/static-site/dist_expected/404.html @@ -0,0 +1,16 @@ + + + + + + Document - Minimal - Gracile - 404 + + + + +

⚠️ 404 not found!!

+ +

http://gracile-static/404/ not found.

+ + + \ No newline at end of file diff --git a/integration/__fixtures__/static-site/dist_expected/index.html b/integration/__fixtures__/static-site/dist_expected/index.html index 33e083d..60d6064 100644 --- a/integration/__fixtures__/static-site/dist_expected/index.html +++ b/integration/__fixtures__/static-site/dist_expected/index.html @@ -3,7 +3,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/src/documents/document-minimal.ts b/integration/__fixtures__/static-site/src/documents/document-minimal.ts index 98bf181..cc60c76 100644 --- a/integration/__fixtures__/static-site/src/documents/document-minimal.ts +++ b/integration/__fixtures__/static-site/src/documents/document-minimal.ts @@ -1,12 +1,12 @@ import { html } from '@lit-labs/ssr'; -export function document(context: { url: URL }) { +export function document(context: { url: URL; title?: string }) { return html` - Document - Minimal + Document - Minimal - ${context.title ?? 'Untitled'} diff --git a/integration/__fixtures__/static-site/src/routes/00-routes/_00-basic_expected.html b/integration/__fixtures__/static-site/src/routes/00-routes/_00-basic_expected.html index 92a10a0..aa0b988 100644 --- a/integration/__fixtures__/static-site/src/routes/00-routes/_00-basic_expected.html +++ b/integration/__fixtures__/static-site/src/routes/00-routes/_00-basic_expected.html @@ -4,7 +4,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-jupiter.html b/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-jupiter.html index 02bba0a..33e1787 100644 --- a/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-jupiter.html +++ b/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-jupiter.html @@ -4,7 +4,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-omega.html b/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-omega.html index 5a7d98a..798394c 100644 --- a/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-omega.html +++ b/integration/__fixtures__/static-site/src/routes/00-routes/_01-param_expected-omega.html @@ -4,7 +4,7 @@ - Document - Minimal + Document - Minimal - Untitled diff --git a/integration/__fixtures__/static-site/src/routes/404.ts b/integration/__fixtures__/static-site/src/routes/404.ts new file mode 100644 index 0000000..502d474 --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/404.ts @@ -0,0 +1,14 @@ +import { defineRoute } from '@gracile/gracile/route'; +import { html } from '@gracile/gracile/server-html'; + +import { document } from '../documents/document-minimal.js'; + +export default defineRoute({ + document: (context) => document({ ...context, title: 'Gracile - 404' }), + + template: (context) => html` +

⚠️ 404 not found!!

+ +

${context.url.toString()} not found.

+ `, +}); diff --git a/integration/__fixtures__/static-site/src/routes/_00-basic_expected.html b/integration/__fixtures__/static-site/src/routes/_00-basic_expected.html new file mode 100644 index 0000000..aa0b988 --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/_00-basic_expected.html @@ -0,0 +1,17 @@ + + + + + + + Document - Minimal - Untitled + + + + +

Hello world

+
+ /00-routes/00-basic/ + + + diff --git a/integration/__fixtures__/static-site/src/routes/_404_expected.html b/integration/__fixtures__/static-site/src/routes/_404_expected.html new file mode 100644 index 0000000..e98267a --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/_404_expected.html @@ -0,0 +1,15 @@ + + + + + + + Document - Minimal - Gracile - 404 + + + +

⚠️ 404 not found!!

+ +

http://localhost:4549/404/ not found.

+ + diff --git a/integration/__fixtures__/static-site/src/routes/_does_not_exist_expected.html b/integration/__fixtures__/static-site/src/routes/_does_not_exist_expected.html new file mode 100644 index 0000000..2d64e06 --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/_does_not_exist_expected.html @@ -0,0 +1,15 @@ + + + + + + + Document - Minimal - Gracile - 404 + + + +

⚠️ 404 not found!!

+ +

http://localhost:4549/does_not_exist/ not found.

+ + diff --git a/integration/__fixtures__/static-site/src/routes/_throws_expected.html b/integration/__fixtures__/static-site/src/routes/_throws_expected.html new file mode 100644 index 0000000..3996ba9 --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/_throws_expected.html @@ -0,0 +1,62 @@ + + + + + + + + + + + Error + + + + +
+

😵 An error has occurred!

+ + +
+ +
+Error: !!! OH NO !!! I AM A FAKE ERROR !!!
+    at RouteModule.template (__REPLACED_FOR_TESTS__/__fixtures__/static-site/src/routes/throws.ts:7:2)
+    at renderRouteTemplate (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/render/route-template.js:110:74)
+    at async middleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/request.js:136:26)
+    at async nodeMiddleware (file:///Volumes/n_1024a-Projects/Repositories/packages/@gracile/gracile/packages/engine/dist/server/node.js:19:24)
+ + + +
+
+ + + + diff --git a/integration/__fixtures__/static-site/src/routes/throws.ts b/integration/__fixtures__/static-site/src/routes/throws.ts new file mode 100644 index 0000000..8c37ba2 --- /dev/null +++ b/integration/__fixtures__/static-site/src/routes/throws.ts @@ -0,0 +1,17 @@ +import { defineRoute } from '@gracile/gracile/route'; +import { html } from '@gracile/gracile/server-html'; + +import { document } from '../documents/document-minimal.js'; + +export default defineRoute({ + document: (context) => document({ ...context, title: 'Gracile - Oh no' }), + + template: (context) => { + throw new Error('!!! OH NO !!! I AM A FAKE ERROR !!!'); + html` +

⚠️ Arrrrrhh !!

+ +

${context.url.toString()} not found.

+ `; + }, +}); diff --git a/integration/__fixtures__/static-site/vite.config.ts b/integration/__fixtures__/static-site/vite.config.ts index 4825d3a..21ff874 100644 --- a/integration/__fixtures__/static-site/vite.config.ts +++ b/integration/__fixtures__/static-site/vite.config.ts @@ -5,10 +5,17 @@ import { viteSvgPlugin } from '@gracile/svg/vite'; import { viteMarkdownPlugin } from '@gracile/markdown/vite'; import { MarkdownRenderer } from '@gracile/markdown-preset-marked'; -export default defineConfig({ - plugins: [ - gracile(), - viteSvgPlugin(), - viteMarkdownPlugin({ MarkdownRenderer }), - ], +export default defineConfig(({ command }) => { + console.log({ command }); + return { + plugins: [ + gracile({ + routes: { + exclude: command === 'build' ? ['**/throws.ts'] : [], + }, + }), + viteSvgPlugin(), + viteMarkdownPlugin({ MarkdownRenderer }), + ], + }; }); diff --git a/integration/manual-tests.sh b/integration/manual-tests.sh index abf83cb..d87849d 100644 --- a/integration/manual-tests.sh +++ b/integration/manual-tests.sh @@ -8,6 +8,7 @@ pnpm tsx --test src/server-express/dev-all-around.test.ts pnpm tsx --test src/server-express/01-build.test.ts pnpm tsx --test src/server-express/02-runs-after-build.test.ts pnpm tsx --test src/custom-elements.test.ts +pnpm tsx --test src/build-mode/project-core.test.ts pnpm tsx --test --test-concurrency=1 src/polyfills.test.ts # aa pnpm tsx --test --test-concurrency=1,1 \ diff --git a/integration/src/addons/markdown.test.ts b/integration/src/addons/markdown.test.ts index c23ce33..2cd151a 100644 --- a/integration/src/addons/markdown.test.ts +++ b/integration/src/addons/markdown.test.ts @@ -13,6 +13,7 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '11-markdown'; +const writeActual = false; // --- it('MD rendering with marked', async () => { @@ -21,7 +22,7 @@ it('MD rendering with marked', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); diff --git a/integration/src/addons/metadata.test.ts b/integration/src/addons/metadata.test.ts index ef3eff9..aad74f5 100644 --- a/integration/src/addons/metadata.test.ts +++ b/integration/src/addons/metadata.test.ts @@ -13,6 +13,7 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '09-metadata'; +const writeActual = false; // --- it('metadata', async () => { @@ -21,7 +22,7 @@ it('metadata', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); diff --git a/integration/src/addons/svg.test.ts b/integration/src/addons/svg.test.ts index 27e311d..b67ef97 100644 --- a/integration/src/addons/svg.test.ts +++ b/integration/src/addons/svg.test.ts @@ -13,6 +13,7 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '10-svg'; +const writeActual = false; // --- it('svg', async () => { @@ -21,7 +22,7 @@ it('svg', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); diff --git a/integration/src/assets.test.ts b/integration/src/assets.test.ts index ca8539c..aa14daf 100644 --- a/integration/src/assets.test.ts +++ b/integration/src/assets.test.ts @@ -14,6 +14,8 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '01-assets'; +const writeActual = false; + // --- // FIXME: the async await stuff is superfluous @@ -32,7 +34,7 @@ describe('sibling assets', async () => { `_${route}_expected.html`, ], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); @@ -50,7 +52,7 @@ describe('sibling assets', async () => { { trailingSlash: false }, ), ), - writeActual: false, + writeActual, prettier: false, }); }); @@ -69,7 +71,7 @@ describe('sibling assets', async () => { { trailingSlash: false }, ), ), - writeActual: false, + writeActual, prettier: false, }); }); @@ -89,7 +91,7 @@ describe('assets with query url', async () => { `_${route}_expected.html`, ], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); }); diff --git a/integration/src/build-mode/project-core.test.ts b/integration/src/build-mode/project-core.test.ts index 6c50735..47fcad4 100644 --- a/integration/src/build-mode/project-core.test.ts +++ b/integration/src/build-mode/project-core.test.ts @@ -7,6 +7,8 @@ import { compareFolder } from '../__utils__/snapshot.js'; const projectDist = 'static-site/dist'; const projectDistExpected = 'static-site/dist_expected'; +const writeActual = false; + // --- // FIXME: Missing a proper close on crash (like for dev.) @@ -17,6 +19,6 @@ it('build and compare outputs', async () => { await compareFolder({ actualPath: projectDist, expectedPath: projectDistExpected, - writeActual: false, + writeActual, }); }); diff --git a/integration/src/custom-elements.test.ts b/integration/src/custom-elements.test.ts index ed1e73a..d665925 100644 --- a/integration/src/custom-elements.test.ts +++ b/integration/src/custom-elements.test.ts @@ -14,6 +14,7 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '03-custom-elements'; +const writeActual = false; // --- it('render Lit element - Full', async () => { @@ -22,7 +23,7 @@ it('render Lit element - Full', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); await snapshotAssertEqual({ @@ -36,7 +37,7 @@ it('render Lit element - Full', async () => { ['/src/routes', currentTestRoutes, `${route}.client.ts`], { trailingSlash: false }, ), - writeActual: false, + writeActual, prettier: false, }); @@ -51,7 +52,7 @@ it('render Lit element - Full', async () => { ['/src/routes', currentTestRoutes, '_lit-element.ts'], { trailingSlash: false }, ).then((r) => removeLocalPathsInDevAssets(r)), - writeActual: false, + writeActual, prettier: false, }); }); diff --git a/integration/src/polyfills.test.ts b/integration/src/polyfills.test.ts index 4ec448e..5ab6e45 100644 --- a/integration/src/polyfills.test.ts +++ b/integration/src/polyfills.test.ts @@ -13,6 +13,8 @@ const { address, close } = await createStaticDevServer({ const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '04-polyfills'; +const writeActual = false; + // --- // NOTE: Not well tested enough. Should check for inline module content. @@ -23,7 +25,7 @@ it('client polyfills', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); diff --git a/integration/src/routes.test.ts b/integration/src/routes.test.ts index e2a5d28..ae40a3e 100644 --- a/integration/src/routes.test.ts +++ b/integration/src/routes.test.ts @@ -8,21 +8,49 @@ import { snapshotAssertEqual } from './__utils__/snapshot.js'; const projectRoutes = 'static-site/src/routes'; const currentTestRoutes = '00-routes'; +const writeActual = false; + const { address, close } = await createStaticDevServer({ project: 'static-site', port: 4549, }); +it('return basic 404', async () => { + const route = 'does_not_exist'; + + await snapshotAssertEqual({ + expectedPath: [projectRoutes, `_${route}_expected.html`], + actualContent: await fetchResource(address, [route]), + writeActual, + }); +}); +it('return basic 404 - direct', async () => { + const route = '404'; + + await snapshotAssertEqual({ + expectedPath: [projectRoutes, `_${route}_expected.html`], + actualContent: await fetchResource(address, [route]), + writeActual, + }); +}); +it('return an error page on route error', async () => { + const route = 'throws'; + + await snapshotAssertEqual({ + expectedPath: [projectRoutes, `_${route}_expected.html`], + actualContent: await fetchResource(address, [route]), + writeActual, + }); +}); + it('return basic route', async () => { const route = '00-basic'; - // await tryOrClose(async () => { await snapshotAssertEqual({ - expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], + expectedPath: [projectRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); - // }); }); it('return doc only route', async () => { @@ -31,7 +59,7 @@ it('return doc only route', async () => { await snapshotAssertEqual({ expectedPath: [projectRoutes, currentTestRoutes, `_${route}_expected.html`], actualContent: await fetchResource(address, [currentTestRoutes, route]), - writeActual: false, + writeActual, }); }); @@ -49,7 +77,7 @@ it('return 1 param static route', async () => { route, 'omega', ]), - writeActual: false, + writeActual, }); await snapshotAssertEqual({ @@ -63,7 +91,7 @@ it('return 1 param static route', async () => { route, 'jupiter', ]), - writeActual: false, + writeActual, }); }); diff --git a/integration/src/server-express/02-runs-after-build.test.ts b/integration/src/server-express/02-runs-after-build.test.ts index 96cc771..129e829 100644 --- a/integration/src/server-express/02-runs-after-build.test.ts +++ b/integration/src/server-express/02-runs-after-build.test.ts @@ -21,10 +21,12 @@ await it('runs and execute test suites', async () => { reject(new Error(`CLOSED UNEXPECTEDLY!`)); }); gracileProcess.stderr.on('data', (data: unknown) => { - reject(new Error(String(data))); + console.log(String(data)); + // resolve(new Error(String(data))); }); gracileProcess.on('error', (err) => { - reject(err); + console.log(String(err)); + // reject(err); }); gracileProcess.stdout.on('data', (data: unknown) => { console.log(String(data)); diff --git a/integration/src/server-express/_common.ts b/integration/src/server-express/_common.ts index eb5b416..895ca14 100644 --- a/integration/src/server-express/_common.ts +++ b/integration/src/server-express/_common.ts @@ -49,6 +49,15 @@ async function tests(mode: string, writeActual: boolean) { ), )); + await it('load the 404 page', async () => + snapshotAssertEqual({ + expectedPath: expectedPath('404'), + actualContent: removeLocalPathsInDevAssets( + await fetchResource(ADDRESS, ['404']), + ), + writeActual, + })); + await it('load a basic page', async () => snapshotAssertEqual({ expectedPath: expectedPath('about'), @@ -81,6 +90,15 @@ async function tests(mode: string, writeActual: boolean) { ), writeActual, })); + + await it('load an error page when a route throws', async () => + snapshotAssertEqual({ + expectedPath: expectedPath('throws'), + actualContent: removeLocalPathsInDevAssets( + await fetchResource(ADDRESS, ['throws']), + ), + writeActual, + })); } export async function common(mode: string, writeActual = false) { diff --git a/integration/src/server-express/dev-all-around.test.ts b/integration/src/server-express/dev-all-around.test.ts index a79b51f..017e312 100644 --- a/integration/src/server-express/dev-all-around.test.ts +++ b/integration/src/server-express/dev-all-around.test.ts @@ -5,6 +5,8 @@ import { createStaticDevServer } from '../__utils__/gracile-server.js'; // import { createDynamicDevServer } from '../__utils__/gracile-server.js'; import { common } from './_common.js'; +const writeActual = false; + const { /* address, */ close } = await createStaticDevServer({ project: 'server-express', port: 9874, @@ -13,6 +15,6 @@ const { /* address, */ close } = await createStaticDevServer({ // --- -common('dev', true); +common('dev', writeActual); after(async () => close()); diff --git a/local-ci.sh b/local-ci.sh index 1fe6a2e..5b271b2 100755 --- a/local-ci.sh +++ b/local-ci.sh @@ -1,10 +1,13 @@ #!/bin/bash +node --run format:fix +node --run lint:es:fix + set -e pnpm install --frozen-lockfile -# TODO: More tests +# TODO: More # node --run syncpack:lint pnpm audit signatures