Commit Graph

26 Commits

Author SHA1 Message Date
Szymon Łągiewka
41113599af fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Douglas Christopher Wilson
80f1ea9bec Improve error message when autoloading invalid view engine
fixes #3403
2017-09-25 21:11:33 -04:00
Kunal Pathak
19a2eeb476 tests: check render error without engine-specific message
closes #3251
2017-09-21 22:45:26 -04:00
chainhelen
eece3850bc tests: use path.join instead of concatenation
closes #3236
2017-03-05 23:08:47 -05:00
Douglas Christopher Wilson
0634e7e189 tests: add test for rendering extensionless file without view engine 2015-06-20 12:54:52 -04:00
Douglas Christopher Wilson
4aa2801054 Merge tag '3.18.6' 2014-12-12 22:06:21 -05:00
Douglas Christopher Wilson
91824514ce tests: run render tests with internal template engine 2014-11-28 09:10:44 -05:00
Douglas Christopher Wilson
6614352563 Add support for app.set('views', array)
closes #2320
2014-10-23 17:28:53 -04:00
Douglas Christopher Wilson
766b3aecf7 deps: update example dependencies 2014-05-29 23:39:52 -04:00
Jonathan Ong
328c6d3060 remove unnecessary test/support/http
backport of 643397ed21
2014-05-18 00:57:54 -04:00
Douglas Christopher Wilson
203fb05d3e update example dependencies 2014-04-24 17:05:20 -04:00
Jonathan Ong
643397ed21 remove unnecessary test/support/http 2014-03-05 22:06:14 -08:00
Roman Shtylman
4983c38298 change res.locals to a plain js object.
Anyone who wants something fancier should use modules.

- fixes annoyance with not being able to set 'name' property on locals
2014-01-27 19:17:29 -05:00
TJ Holowaychuk
1029b0b97f adjust locals tests 2012-09-25 08:45:09 -07:00
TJ Holowaychuk
0f5560eebd updated tests to use "supertest" 2012-06-26 17:14:07 -07:00
Tj Holowaychuk
83fb9f7548 removed a test 2011-12-06 16:12:42 -08:00
Tj Holowaychuk
8f45dd4190 Added res.render() absolute path tests 2011-11-10 08:24:10 -08:00
Tj Holowaychuk
7d42ad00ff Removed "status" and "charset" options 2011-11-10 07:47:04 -08:00
Tj Holowaychuk
1f53cdb62d Added error in res.render() callback test 2011-11-09 15:21:38 -08:00
Tj Holowaychuk
c32023d8ed Added "charset" option test 2011-11-09 15:17:44 -08:00
Tj Holowaychuk
d2f98940d8 Added status option test 2011-11-09 15:15:55 -08:00
Tj Holowaychuk
536b16c7a9 Added res.render() callback with locals test 2011-11-09 15:11:07 -08:00
Tj Holowaychuk
9bfeae2df1 Added res.render() callback tests 2011-11-09 15:09:47 -08:00
Tj Holowaychuk
4d450ea25e local precedence tests 2011-11-09 15:04:52 -08:00
Tj Holowaychuk
84f01d1e30 Added res.render() tests 2011-11-09 15:00:40 -08:00