Skip to content

Conversation

@arcaniussainey
Copy link

I have removed glob:glob and replaced with node/fs:glob. Code style has remained largely the same, however it seems there is still some test cases that are producing additional errors such as the following:

test at test\static.test.js:3756:11
�[31mΓ£û /bar.private �[90m(2.5834ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

This was decided via diffing the testcase output of the main branch and my PR. If I'm doing something stupid with the new version let me know and I'll fix it then resubmit.

This change will constrain releases to node >= 20, as node/fs:glob was added around then. I've included my testcase output below.


> @fastify/[email protected] test
> npm run test:unit && npm run test:typescript


> @fastify/[email protected] test:unit
> borp -C --check-coverage --lines 100

Γû╢ register /static prefixAvoidTrailingSlash
  �[32mΓ£ö /static/index.html �[90m(52.5734ms)�[39m�[39m
  �[32mΓ£ö /static/index.css �[90m(5.6032ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(4.347ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(3.6001ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/purpose/foo.html �[90m(3.1388ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/ �[90m(3.2322ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/for/test �[90m(3.2323ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/doesnt/exist.html �[90m(1.7148ms)�[39m�[39m
  �[32mΓ£ö /static/../index.js �[90m(1.848ms)�[39m�[39m
  �[32mΓ£ö file not exposed outside of the plugin �[90m(1.4677ms)�[39m�[39m
  �[32mΓ£ö file retrieve with HEAD method �[90m(5.7986ms)�[39m�[39m
�[32mΓ£ö register /static prefixAvoidTrailingSlash �[90m(141.0226ms)�[39m�[39m
Γû╢ register /static
  �[32mΓ£ö /static/index.html �[90m(3.3748ms)�[39m�[39m
  �[32mΓ£ö /static/index.css �[90m(3.3523ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(2.8803ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(1.3236ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/purpose/foo.html �[90m(2.1045ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/ �[90m(2.3015ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/for/test �[90m(1.6918ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/doesnt/exist.html �[90m(1.7275ms)�[39m�[39m
  �[32mΓ£ö /static/../index.js �[90m(2.4037ms)�[39m�[39m
  �[32mΓ£ö file not exposed outside of the plugin �[90m(1.5794ms)�[39m�[39m
�[32mΓ£ö register /static �[90m(32.4206ms)�[39m�[39m
Γû╢ register /static/
  �[32mΓ£ö /static/index.html �[90m(2.7257ms)�[39m�[39m
  �[32mΓ£ö /static/index.html �[90m(2.8023ms)�[39m�[39m
  �[32mΓ£ö /static/index.css �[90m(2.1565ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(4.6565ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(1.1728ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/purpose/foo.html �[90m(1.7366ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/ �[90m(1.9889ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/for/test �[90m(1.4347ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/doesnt/exist.html �[90m(1.4835ms)�[39m�[39m
  �[32mΓ£ö /static/../index.js �[90m(1.1184ms)�[39m�[39m
  �[32mΓ£ö 304 �[90m(3.8051ms)�[39m�[39m
�[32mΓ£ö register /static/ �[90m(31.8104ms)�[39m�[39m
Γû╢ register /static and /static2
  �[32mΓ£ö /static/index.html �[90m(2.8263ms)�[39m�[39m
  �[32mΓ£ö /static/bar.html �[90m(3.6365ms)�[39m�[39m
  �[32mΓ£ö sendFile foo.html �[90m(2.5868ms)�[39m�[39m
  �[32mΓ£ö sendFile bar.html �[90m(2.2655ms)�[39m�[39m
�[32mΓ£ö register /static and /static2 �[90m(17.9607ms)�[39m�[39m
Γû╢ register /static with constraints
  �[32mΓ£ö example.com/static/index.html �[90m(3.0221ms)�[39m�[39m
  �[32mΓ£ö not-example.com/static/index.html �[90m(2.2404ms)�[39m�[39m
�[32mΓ£ö register /static with constraints �[90m(11.5499ms)�[39m�[39m
Γû╢ payload.path is set
  �[32mΓ£ö /static/index.html �[90m(2.889ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/doesnt/exist.html �[90m(5.7403ms)�[39m�[39m
�[32mΓ£ö payload.path is set �[90m(14.8921ms)�[39m�[39m
Γû╢ error responses can be customized with fastify.setErrorHandler()
  �[32mΓ£ö /../index.js �[90m(2.8509ms)�[39m�[39m
�[32mΓ£ö error responses can be customized with fastify.setErrorHandler() �[90m(9.0584ms)�[39m�[39m
Γû╢ not found responses can be customized with fastify.setNotFoundHandler()
  �[32mΓ£ö /path/does/not/exist.html �[90m(2.4644ms)�[39m�[39m
�[32mΓ£ö not found responses can be customized with fastify.setNotFoundHandler() �[90m(7.7498ms)�[39m�[39m
Γû╢ fastify.setNotFoundHandler() is called for dotfiles when send is configured to ignore dotfiles
  �[32mΓ£ö /path/does/not/.exist.html �[90m(2.3207ms)�[39m�[39m
�[32mΓ£ö fastify.setNotFoundHandler() is called for dotfiles when send is configured to ignore dotfiles �[90m(7.1841ms)�[39m�[39m
Γû╢ serving disabled
  �[32mΓ£ö /static/index.html not found �[90m(1.9539ms)�[39m�[39m
  �[32mΓ£ö /static/index.html via sendFile found �[90m(2.7135ms)�[39m�[39m
�[32mΓ£ö serving disabled �[90m(10.2204ms)�[39m�[39m
Γû╢ serving disabled without root
  �[32mΓ£ö /static/index.html via sendFile not found �[90m(2.8418ms)�[39m�[39m
  �[32mΓ£ö /static/index.html via sendFile with relative path not found �[90m(1.868ms)�[39m�[39m
�[32mΓ£ö serving disabled without root �[90m(10.3957ms)�[39m�[39m
Γû╢ sendFile
  �[32mΓ£ö reply.sendFile() �[90m(3.0097ms)�[39m�[39m
  �[32mΓ£ö reply.sendFile() with rootPath �[90m(3.0852ms)�[39m�[39m
  �[32mΓ£ö reply.sendFile() again without root path �[90m(2.163ms)�[39m�[39m
  �[32mΓ£ö reply.sendFile() with options �[90m(2.4873ms)�[39m�[39m
�[32mΓ£ö sendFile �[90m(16.982ms)�[39m�[39m
Γû╢ sendFile disabled
  �[32mΓ£ö reply.sendFile undefined �[90m(2.4962ms)�[39m�[39m
�[32mΓ£ö sendFile disabled �[90m(8.2784ms)�[39m�[39m
Γû╢ allowedPath option - pathname
  �[32mΓ£ö /foobar.html not found �[90m(2.3546ms)�[39m�[39m
  �[32mΓ£ö /index.css found �[90m(2.8103ms)�[39m�[39m
�[32mΓ£ö allowedPath option - pathname �[90m(10.4011ms)�[39m�[39m
Γû╢ allowedPath option - request
  �[32mΓ£ö /foobar.html not found �[90m(2.152ms)�[39m�[39m
  �[32mΓ£ö /index.css found �[90m(2.9907ms)�[39m�[39m
�[32mΓ£ö allowedPath option - request �[90m(10.4787ms)�[39m�[39m
Γû╢ download
  �[32mΓ£ö reply.download() �[90m(3.4585ms)�[39m�[39m
  �[32mΓ£ö reply.download() with fileName �[90m(3.0565ms)�[39m�[39m
  �[32mΓ£ö reply.download() with fileName - override �[90m(1.9489ms)�[39m�[39m
  �[32mΓ£ö reply.download() with custom opts �[90m(2.4066ms)�[39m�[39m
  �[32mΓ£ö reply.download() with custom opts (2) �[90m(1.8257ms)�[39m�[39m
  �[32mΓ£ö reply.download() with rootPath and fileName �[90m(1.7151ms)�[39m�[39m
�[32mΓ£ö download �[90m(21.7857ms)�[39m�[39m
Γû╢ download disabled
  �[32mΓ£ö reply.sendFile undefined �[90m(2.2708ms)�[39m�[39m
�[32mΓ£ö download disabled �[90m(10.0621ms)�[39m�[39m
�[32mΓ£ö prefix default �[90m(0.532ms)�[39m�[39m
�[32mΓ£ö root not found warning �[90m(25.4209ms)�[39m�[39m
�[32mΓ£ö send options �[90m(19.7037ms)�[39m�[39m
�[32mΓ£ö setHeaders option �[90m(6.7064ms)�[39m�[39m
�[32mΓ£ö maxAge option �[90m(6.6989ms)�[39m�[39m
Γû╢ errors
  �[32mΓ£ö no root �[90m(1.8093ms)�[39m�[39m
  �[32mΓ£ö root is not a string �[90m(1.1803ms)�[39m�[39m
  �[32mΓ£ö root is not an absolute path �[90m(1.2177ms)�[39m�[39m
  �[32mΓ£ö root is not a directory �[90m(1.2773ms)�[39m�[39m
  �[32mΓ£ö root is an empty array �[90m(1.215ms)�[39m�[39m
  �[32mΓ£ö root array does not contain strings �[90m(1.213ms)�[39m�[39m
  �[32mΓ£ö root array does not contain an absolute path �[90m(1.3024ms)�[39m�[39m
  �[32mΓ£ö root array path is not a directory �[90m(1.4433ms)�[39m�[39m
  �[32mΓ£ö all root array paths must be valid �[90m(1.4726ms)�[39m�[39m
  �[32mΓ£ö no root and serve: false �[90m(1.3985ms)�[39m�[39m
  �[32mΓ£ö duplicate root paths are not allowed �[90m(1.2013ms)�[39m�[39m
  �[32mΓ£ö setHeaders is not a function �[90m(1.2814ms)�[39m�[39m
�[32mΓ£ö errors �[90m(16.9757ms)�[39m�[39m
Γû╢ register no prefix
  �[32mΓ£ö /index.html �[90m(2.6409ms)�[39m�[39m
  �[32mΓ£ö /index.css �[90m(2.4949ms)�[39m�[39m
  �[32mΓ£ö / �[90m(1.7512ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/purpose/foo.html �[90m(1.6825ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/ �[90m(1.7163ms)�[39m�[39m
  �[32mΓ£ö /this/path/doesnt/exist.html �[90m(1.2073ms)�[39m�[39m
  �[32mΓ£ö /../index.js �[90m(1.0667ms)�[39m�[39m
�[32mΓ£ö register no prefix �[90m(22.8675ms)�[39m�[39m
Γû╢ with fastify-compress
  �[32mΓ£ö deflate �[90m(10.1099ms)�[39m�[39m
  �[32mΓ£ö gzip �[90m(4.0109ms)�[39m�[39m
�[32mΓ£ö with fastify-compress �[90m(19.0904ms)�[39m�[39m
Γû╢ register /static/ with schemaHide true
  �[32mΓ£ö /static/index.html �[90m(2.4424ms)�[39m�[39m
�[32mΓ£ö register /static/ with schemaHide true �[90m(6.5583ms)�[39m�[39m
Γû╢ register /static/ with schemaHide false
  �[32mΓ£ö /static/index.html �[90m(2.2545ms)�[39m�[39m
�[32mΓ£ö register /static/ with schemaHide false �[90m(6.3647ms)�[39m�[39m
Γû╢ register /static/ without schemaHide
  �[32mΓ£ö /static/index.html �[90m(2.4055ms)�[39m�[39m
�[32mΓ£ö register /static/ without schemaHide �[90m(6.5713ms)�[39m�[39m
Γû╢ fastify with exposeHeadRoutes
  �[32mΓ£ö /index.html �[90m(2.5771ms)�[39m�[39m
�[32mΓ£ö fastify with exposeHeadRoutes �[90m(15.366ms)�[39m�[39m
Γû╢ register with wildcard false
  �[32mΓ£ö /index.html �[90m(2.5048ms)�[39m�[39m
  �[32mΓ£ö /index.css �[90m(2.258ms)�[39m�[39m
  �[32mΓ£ö / �[90m(1.7155ms)�[39m�[39m
  �[32mΓ£ö /not-defined �[90m(1.222ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/purpose/foo.html �[90m(1.6281ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/ �[90m(1.6199ms)�[39m�[39m
  �[32mΓ£ö /../index.js �[90m(1.1321ms)�[39m�[39m
(node:16440) [FSTDEP022] FastifyWarning: The router options for ignoreTrailingSlash property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.
(Use `node --trace-warnings ...` to show where the warning was created)
  �[32mΓ£ö /index.css �[90m(1.7903ms)�[39m�[39m
�[32mΓ£ö register with wildcard false �[90m(22.7169ms)�[39m�[39m
Γû╢ register with wildcard false (trailing slash in the root)
  �[32mΓ£ö /index.css �[90m(2.5794ms)�[39m�[39m
  �[32mΓ£ö /not-defined �[90m(1.8033ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/purpose/foo.html �[90m(1.6781ms)�[39m�[39m
  �[32mΓ£ö /../index.js �[90m(1.0379ms)�[39m�[39m
  �[32mΓ£ö /index.css �[90m(1.5655ms)�[39m�[39m
�[32mΓ£ö register with wildcard false (trailing slash in the root) �[90m(21.2207ms)�[39m�[39m
�[32mΓ£ö register with wildcard string �[90m(1.4274ms)�[39m�[39m
�[32mΓ£ö register with wildcard string on multiple root paths �[90m(1.6482ms)�[39m�[39m
Γû╢ register with wildcard false and alternative index
  �[32mΓ£ö /index.html �[90m(2.7939ms)�[39m�[39m
  �[32mΓ£ö /index.html �[90m(2.6272ms)�[39m�[39m
  �[32mΓ£ö /index.css �[90m(1.5154ms)�[39m�[39m
  �[32mΓ£ö /?a=b �[90m(2.4556ms)�[39m�[39m
  �[32mΓ£ö /?a=b �[90m(1.5895ms)�[39m�[39m
  �[32mΓ£ö /not-defined �[90m(1.157ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/purpose/ �[90m(2.5886ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/ �[90m(1.9632ms)�[39m�[39m
  �[32mΓ£ö /deep/path/for/test/ �[90m(1.7396ms)�[39m�[39m
  �[32mΓ£ö /../index.js �[90m(1.1692ms)�[39m�[39m
�[32mΓ£ö register with wildcard false and alternative index �[90m(28.8957ms)�[39m�[39m
Γû╢ register /static with wildcard false and alternative index
  �[32mΓ£ö /static/index.html �[90m(2.8125ms)�[39m�[39m
  �[32mΓ£ö /static/index.html �[90m(2.3407ms)�[39m�[39m
(node:16440) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
  �[32mΓ£ö /static/index.css �[90m(1.4902ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(4.6273ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(1.7356ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(2.1709ms)�[39m�[39m
  �[32mΓ£ö /static/not-defined �[90m(1.1346ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/purpose/ �[90m(2.585ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/ �[90m(1.9126ms)�[39m�[39m
  �[32mΓ£ö /static/../index.js �[90m(1.1527ms)�[39m�[39m
�[32mΓ£ö register /static with wildcard false and alternative index �[90m(31.4051ms)�[39m�[39m
Γû╢ register /static with redirect true
  �[32mΓ£ö /static?a=b �[90m(5.9651ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(1.582ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(1.6677ms)�[39m�[39m
  �[32mΓ£ö /static/deep �[90m(2.0102ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test?a=b �[90m(6.9139ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test �[90m(2.3296ms)�[39m�[39m
�[32mΓ£ö register /static with redirect true �[90m(25.8411ms)�[39m�[39m
�[31mΓ£û register /static with redirect true and wildcard false �[90m(6.004ms)�[39m�[39m
Γû╢ trailing slash behavior with redirect = false
  �[32mΓ£ö prefix with no trailing slash => 404 �[90m(1.6939ms)�[39m�[39m
  �[32mΓ£ö prefix with trailing trailing slash => 200 �[90m(2.1826ms)�[39m�[39m
  �[32mΓ£ö deep path with no index.html or trailing slash => 404 �[90m(1.424ms)�[39m�[39m
  �[32mΓ£ö deep path with index.html but no trailing slash => 200 �[90m(1.7246ms)�[39m�[39m
  �[32mΓ£ö deep path with index.html and trailing slash => 200 �[90m(1.4566ms)�[39m�[39m
�[32mΓ£ö trailing slash behavior with redirect = false �[90m(13.7087ms)�[39m�[39m
Γû╢ if dotfiles are properly served according to plugin options
  �[32mΓ£ö freely serve dotfiles �[90m(6.3678ms)�[39m�[39m
  �[32mΓ£ö ignore dotfiles �[90m(6.1019ms)�[39m�[39m
  �[32mΓ£ö deny requests to serve a dotfile �[90m(6.0508ms)�[39m�[39m
�[32mΓ£ö if dotfiles are properly served according to plugin options �[90m(19.1533ms)�[39m�[39m
�[31mΓ£û register with failing glob handler �[90m(12.9138ms)�[39m�[39m
�[32mΓ£ö register with rootpath that causes statSync to fail with non-ENOENT code �[90m(5.3887ms)�[39m�[39m
�[32mΓ£ö inject support �[90m(3.2611ms)�[39m�[39m
�[32mΓ£ö routes should use custom errorHandler premature stream close �[90m(1.8628ms)�[39m�[39m
�[32mΓ£ö routes should fallback to default errorHandler �[90m(1.9679ms)�[39m�[39m
�[32mΓ£ö percent encoded URLs in glob mode �[90m(9.6109ms)�[39m�[39m
Γû╢ register /static and /static2 without wildcard
  �[32mΓ£ö /index.html �[90m(3.2598ms)�[39m�[39m
  �[32mΓ£ö /static/bar.html �[90m(3.7023ms)�[39m�[39m
�[32mΓ£ö register /static and /static2 without wildcard �[90m(16.7026ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .br at the highest priority �[90m(3.4077ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files and fallback to .gz if .br is not on disk �[90m(2.6362ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .gzip if * directive used �[90m(2.4902ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .gzip if multiple * directives used �[90m(2.1903ms)�[39m�[39m
�[32mΓ£ö will serve uncompressed files if there are no compressed variants on disk �[90m(3.1363ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .br at the highest priority (with wildcard: false) �[90m(6.5378ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files and fallback to .gz if .br is not on disk (with wildcard: false) �[90m(5.4194ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .gzip if * directive used (with wildcard: false) �[90m(5.904ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .gzip if multiple * directives used (with wildcard: false) �[90m(6.8345ms)�[39m�[39m
�[32mΓ£ö will serve uncompressed files if there are no compressed variants on disk (with wildcard: false) �[90m(12.1682ms)�[39m�[39m
�[32mΓ£ö will serve uncompressed files the accept-encoding header is missing �[90m(2.8249ms)�[39m�[39m
�[32mΓ£ö will serve precompressed index �[90m(2.556ms)�[39m�[39m
�[32mΓ£ö will serve preCompressed index without trailing slash �[90m(2.6266ms)�[39m�[39m
�[32mΓ£ö will redirect to preCompressed index without trailing slash when redirect is true �[90m(3.0154ms)�[39m�[39m
�[32mΓ£ö will serve precompressed gzip index in subdir �[90m(2.9382ms)�[39m�[39m
�[32mΓ£ö will serve precompressed index with alternative index option �[90m(2.331ms)�[39m�[39m
�[32mΓ£ö will serve precompressed file without content-type charset �[90m(3.0828ms)�[39m�[39m
�[32mΓ£ö will not redirect but serve a file if preCompressed but no compressed file exists and redirect is true �[90m(2.3295ms)�[39m�[39m
�[32mΓ£ö nonexistent index with precompressed option �[90m(1.7185ms)�[39m�[39m
�[32mΓ£ö should not redirect to protocol-relative locations �[90m(13.8288ms)�[39m�[39m
Γû╢ should not serve index if option is `false`
  �[32mΓ£ö /static/index.html �[90m(2.7238ms)�[39m�[39m
  �[32mΓ£ö /static �[90m(1.7146ms)�[39m�[39m
�[32mΓ£ö should not serve index if option is `false` �[90m(9.3773ms)�[39m�[39m
�[31mΓ£û should follow symbolic link without wildcard �[90m(14.3314ms)�[39m�[39m
�[31mΓ£û should serve files into hidden dir with wildcard `false` �[90m(6.9834ms)�[39m�[39m
�[32mΓ£ö should not found hidden file with wildcard is `false` �[90m(6.3002ms)�[39m�[39m
�[32mΓ£ö should serve files into hidden dir without wildcard option �[90m(6.3027ms)�[39m�[39m
�[32mΓ£ö will serve pre-compressed files with .gzip if multi-root �[90m(2.8271ms)�[39m�[39m
�[32mΓ£ö will still serve un-compressed files with multi-root and preCompressed as true �[90m(2.95ms)�[39m�[39m
�[32mΓ£ö converts URL to path �[90m(2.2511ms)�[39m�[39m
�[32mΓ£ö converts array of URLs to path, contains string path �[90m(2.28ms)�[39m�[39m
�[32mΓ£ö serves files with paths that have characters modified by encodeUri when wildcard is false �[90m(4.0543ms)�[39m�[39m
�[32mΓ£ö serves files with % in the filename �[90m(5.642ms)�[39m�[39m
�[32mΓ£ö content-length in head route should not return zero when using wildcard �[90m(6.1412ms)�[39m�[39m
�[32mΓ£ö respect the .code when using with sendFile �[90m(6.379ms)�[39m�[39m
�[32mΓ£ö respect the .type when using with sendFile with contentType disabled �[90m(6.6648ms)�[39m�[39m
Γû╢ register /static/ with custom log level
  �[32mΓ£ö /static/index.html �[90m(3.1093ms)�[39m�[39m
  �[32mΓ£ö /static/index.html �[90m(2.2561ms)�[39m�[39m
  �[32mΓ£ö /static/index.css �[90m(1.5708ms)�[39m�[39m
  �[32mΓ£ö /static/ �[90m(2.4478ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/purpose/foo.html �[90m(1.7372ms)�[39m�[39m
  �[32mΓ£ö /static/deep/path/for/test/ �[90m(1.6565ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/for/test �[90m(1.1804ms)�[39m�[39m
  �[32mΓ£ö /static/this/path/doesnt/exist.html �[90m(1.1476ms)�[39m�[39m
  �[32mΓ£ö 304 �[90m(2.556ms)�[39m�[39m
�[32mΓ£ö register /static/ with custom log level �[90m(24.2365ms)�[39m�[39m
Γû╢ register with wildcard false and globIgnore
  �[32mΓ£ö /index.html �[90m(2.5022ms)�[39m�[39m
  �[31mΓ£û /bar.private �[90m(2.5834ms)�[39m�[39m
  �[32mΓ£ö / �[90m(1.8825ms)�[39m�[39m
  �[32mΓ£ö /deep/path/to/baz.html �[90m(1.6894ms)�[39m�[39m
  �[31mΓ£û /deep/path/to/baz.private �[90m(1.857ms)�[39m�[39m
�[31mΓ£û register with wildcard false and globIgnore �[90m(17.8868ms)�[39m�[39m
�[32mΓ£ö throws when `root` is an array �[90m(2.1091ms)�[39m�[39m
�[32mΓ£ö throws when `list.format` option is invalid �[90m(0.1644ms)�[39m�[39m
�[32mΓ£ö throws when `list.names option` is not an array �[90m(0.146ms)�[39m�[39m
�[32mΓ£ö throws when `list.jsonFormat` option is invalid �[90m(0.1414ms)�[39m�[39m
�[32mΓ£ö throws when `list.format` is html and `list render` is not a function �[90m(0.1491ms)�[39m�[39m
�[32mΓ£ö dir list wrong options �[90m(22.6562ms)�[39m�[39m
Γû╢ dir list default options
  �[31mΓ£û /public/shallow �[90m(55.3474ms)�[39m�[39m
�[31mΓ£û dir list default options �[90m(83.1266ms)�[39m�[39m
Γû╢ dir list, custom options
  �[32mΓ£ö /public/ �[90m(6.8966ms)�[39m�[39m
�[32mΓ£ö dir list, custom options �[90m(18.6158ms)�[39m�[39m
Γû╢ dir list, custom options with empty array index
  �[32mΓ£ö /public/ �[90m(5.3143ms)�[39m�[39m
�[32mΓ£ö dir list, custom options with empty array index �[90m(14.1436ms)�[39m�[39m
Γû╢ dir list html format
  �[32mΓ£ö /public/index.htm �[90m(4.9215ms)�[39m�[39m
  �[32mΓ£ö /public/index �[90m(3.7724ms)�[39m�[39m
�[32mΓ£ö dir list html format �[90m(16.6766ms)�[39m�[39m
Γû╢ dir list href nested structure
  �[32mΓ£ö /public/ �[90m(7.7535ms)�[39m�[39m
  �[32mΓ£ö /public/index �[90m(6.4219ms)�[39m�[39m
  �[32mΓ£ö /public/deep/ �[90m(6.0318ms)�[39m�[39m
  �[32mΓ£ö /public/deep/index.htm �[90m(3.8789ms)�[39m�[39m
  �[32mΓ£ö /public/deep/path/ �[90m(3.1603ms)�[39m�[39m
�[32mΓ£ö dir list href nested structure �[90m(34.0051ms)�[39m�[39m
�[32mΓ£ö dir list html format - stats �[90m(10.2935ms)�[39m�[39m
Γû╢ dir list html format - extended info
  �[32mΓ£ö dirs �[90m(0.431ms)�[39m�[39m
�[32mΓ£ö dir list html format - extended info �[90m(13.7334ms)�[39m�[39m
Γû╢ dir list json format
  �[31mΓ£û /public/shallow/ �[90m(3.3264ms)�[39m�[39m
�[31mΓ£û dir list json format �[90m(9.1626ms)�[39m�[39m
Γû╢ dir list json format - extended info
  �[32mΓ£ö /public/shallow/ �[90m(5.5728ms)�[39m�[39m
�[32mΓ£ö dir list json format - extended info �[90m(11.433ms)�[39m�[39m
�[32mΓ£ö json format with url parameter format �[90m(14.7064ms)�[39m�[39m
�[32mΓ£ö json format with url parameter format and without render option �[90m(13.4054ms)�[39m�[39m
�[32mΓ£ö html format with url parameter format �[90m(11.5125ms)�[39m�[39m
Γû╢ dir list on empty dir
  �[32mΓ£ö /public/shallow/empty �[90m(2.4366ms)�[39m�[39m
�[32mΓ£ö dir list on empty dir �[90m(7.0861ms)�[39m�[39m
Γû╢ dir list serve index.html on index option
  �[32mΓ£ö serve index.html from fs �[90m(7.2382ms)�[39m�[39m
�[32mΓ£ö dir list serve index.html on index option �[90m(13.8356ms)�[39m�[39m
Γû╢ serve a non existent dir and get error
  �[32mΓ£ö /public/ �[90m(2.1801ms)�[39m�[39m
�[32mΓ£ö serve a non existent dir and get error �[90m(6.688ms)�[39m�[39m
Γû╢ serve a non existent dir and get error
  �[32mΓ£ö /public/none/index �[90m(2.3154ms)�[39m�[39m
�[32mΓ£ö serve a non existent dir and get error �[90m(7.3263ms)�[39m�[39m
Γû╢ dir list with dotfiles allow option
  �[32mΓ£ö /public/ �[90m(2.8618ms)�[39m�[39m
�[32mΓ£ö dir list with dotfiles allow option �[90m(7.5909ms)�[39m�[39m
Γû╢ dir list with dotfiles deny option
  �[32mΓ£ö /public/ �[90m(3.4152ms)�[39m�[39m
�[32mΓ£ö dir list with dotfiles deny option �[90m(8.5467ms)�[39m�[39m
Γû╢ dir list with dotfiles ignore option
  �[32mΓ£ö /public/ �[90m(3.4859ms)�[39m�[39m
�[32mΓ£ö dir list with dotfiles ignore option �[90m(8.0478ms)�[39m�[39m
�[32mΓ£ö dir list error �[90m(12.2456ms)�[39m�[39m
Γû╢ register /content-type
  �[32mΓ£ö /content-type/index.html �[90m(43.7937ms)�[39m�[39m
  �[32mΓ£ö /content-type/index.css �[90m(3.922ms)�[39m�[39m
  �[32mΓ£ö /content-type/sample.jpg �[90m(3.234ms)�[39m�[39m
  �[32mΓ£ö /content-type/test.txt �[90m(3.5747ms)�[39m�[39m
  �[32mΓ£ö /content-type/binary �[90m(3.4855ms)�[39m�[39m
�[32mΓ£ö register /content-type �[90m(100.0829ms)�[39m�[39m
Γû╢ register /content-type preCompressed
  �[32mΓ£ö /content-type/index.html �[90m(9.221ms)�[39m�[39m
  �[32mΓ£ö /content-type/index.css �[90m(6.2435ms)�[39m�[39m
  �[32mΓ£ö /content-type/sample.jpg �[90m(5.2866ms)�[39m�[39m
  �[32mΓ£ö /content-type/test.txt �[90m(3.6207ms)�[39m�[39m
  �[32mΓ£ö /content-type/binary �[90m(4.4438ms)�[39m�[39m
�[32mΓ£ö register /content-type preCompressed �[90m(40.7618ms)�[39m�[39m
�[34mΓä╣ tests 293�[39m
�[34mΓä╣ suites 0�[39m
�[34mΓä╣ pass 282�[39m
�[34mΓä╣ fail 11�[39m
�[34mΓä╣ cancelled 0�[39m
�[34mΓä╣ skipped 0�[39m
�[34mΓä╣ todo 0�[39m
�[34mΓä╣ duration_ms 1977.5752�[39m

�[31mΓ£û failing tests:�[39m

test at test\static.test.js:2188:1
�[31mΓ£û register /static with redirect true and wildcard false �[90m(6.004ms)�[39m�[39m
  Error: Method 'HEAD' already declared for route '/static/deep/path/for/test' with constraints '{}'
      at Router._on (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\node_modules\find-my-way\index.js:301:13)
      at Router.on (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\node_modules\find-my-way\index.js:149:10)
      at Object.addNewRoute (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\node_modules\fastify\lib\route.js:352:16)
      at Object.route (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\node_modules\fastify\lib\route.js:263:19)
      at Object._route [as route] (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\node_modules\fastify\fastify.js:208:27)
      at setUpHeadAndGet (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\index.js:401:13)
      at fastifyStatic (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\index.js:174:11)

test at test\static.test.js:2438:1
�[31mΓ£û register with failing glob handler �[90m(12.9138ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: Missing expected rejection.
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:2457:3)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: undefined,
    expected: undefined,
    operator: 'rejects',
    diff: 'simple'
  }

test at test\static.test.js:3255:1
�[31mΓ£û should follow symbolic link without wildcard �[90m(14.3314ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
  
    t.assert.ok(response2.ok)
  
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3272:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }

test at test\static.test.js:3276:1
�[31mΓ£û should serve files into hidden dir with wildcard `false` �[90m(6.9834ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
  
    t.assert.ok(response.ok)
  
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3293:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }

test at test\static.test.js:3756:11
�[31mΓ£û /bar.private �[90m(2.5834ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
  
    t.assert.ok(!response.ok)
  
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3760:14)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3756:3)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }

test at test\static.test.js:3785:11
�[31mΓ£û /deep/path/to/baz.private �[90m(1.857ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
  
    t.assert.ok(!response.ok)
  
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3789:14)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\static.test.js:3785:3)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: '==',
    diff: 'simple'
  }

test at test\dir-list.test.js:123:13
�[31mΓ£û /public/shallow �[90m(55.3474ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    {
      dirs: [
        'empty'
      ],
      files: [
  +     'no-link',
        'sample.jpg'
      ]
    }
  
      at assert.<computed> [as deepStrictEqual] (node:internal/test_runner/test:325:18)
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:129:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:123:5
      at async Object.arrange (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:20:5)
      at async TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:122:3)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: { dirs: [ 'empty' ], files: [ 'no-link', 'sample.jpg' ] },
    expected: { dirs: [ 'empty' ], files: [ 'sample.jpg' ] },
    operator: 'deepStrictEqual',
    diff: 'simple'
  }

test at test\dir-list.test.js:372:15
�[31mΓ£û /public/shallow/ �[90m(3.3264ms)�[39m�[39m
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    {
      dirs: [
        'empty'
      ],
      files: [
  +     'no-link',
        'sample.jpg'
      ]
    }
  
      at assert.<computed> [as deepStrictEqual] (node:internal/test_runner/test:325:18)
      at TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:378:18)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:372:7
      at async Object.arrange (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:20:5)
      at async TestContext.<anonymous> (C:\Users\Brian\Desktop\Fastify\fastify-static-globdep-none\test\dir-list.test.js:370:3)
      at async Test.run (node:internal/test_runner/test:1113:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: { dirs: [ 'empty' ], files: [ 'no-link', 'sample.jpg' ] },
    expected: { dirs: [ 'empty' ], files: [ 'sample.jpg' ] },
    operator: 'deepStrictEqual',
    diff: 'simple'
  }
---------------------------------|---------|----------|---------|---------|-------------------
File                             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------|---------|----------|---------|---------|-------------------
All files                        |   99.49 |    99.19 |     100 |   99.49 |                   
 fastify-static-globdep-none     |     100 |      100 |     100 |     100 |                   
  index.js                       |     100 |      100 |     100 |     100 |                   
 fastify-static-globdep-none/lib |    98.1 |    97.26 |     100 |    98.1 |                   
  dirList.js                     |    98.1 |    97.26 |     100 |    98.1 | 20-21,80-81       
---------------------------------|---------|----------|---------|---------|-------------------

Copy link
Member

@Eomm Eomm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you run npm run lint:fix and commit the changes?

@Eomm Eomm linked an issue Nov 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade or switch from glob

2 participants