Herbert Vojcik
c16508c87a
Better require.async throw test
15 years ago
Herbert Vojcik
d36bb6536e
Better require.async tests
15 years ago
Tim-Smart
0c17067d87
Add require.registerExtension
15 years ago
isaacs
5861db8a69
Remove process.mixin dependency from all tests.
15 years ago
Felix Geisendörfer
44dde5f24c
Remove fs/path globals from test suite
It is way too easy to not notice bugs due to those modules being
exported as globals while running the test suite.
See: http://github.com/ry/node/issues#issue/75
15 years ago
arlolra
04fac19822
Split tests.
15 years ago
Ryan Dahl
ef55324f1a
Do not use Promise in 'fs' module
15 years ago
Felix Geisendörfer
211e82e8d9
Simple test case for require.async()
This is to make sure this doesn't break after implementing the new
truly sync require() function.
15 years ago
Felix Geisendörfer
b02b54e003
Fix: Module cache did not propagate
This patch makes sure nested modules are available in their parents
cache. The module simplification broke this behavior.
See:
http://groups.google.com/group/nodejs/browse_thread/thread/e875132469547d2
b73f61a137
15 years ago
Felix Geisendörfer
b73f61a137
Simplified module system
createModule got removed as it was unnecessary and caused issues by
doing its own cache checks independent of loadModule. Internal modules
are now the only globally cached modules, all other modules are only
cached by inheriting their parent modules cache.
Credits: Module specific cache and a few other diffs by Blaine Cook
431662d25c
http://romeda.org/blog/2010/01/hot-code-loading-in-nodejs.html
http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/1994
15 years ago
Felix Geisendörfer
a76c7a89ce
Implemented __dirname
It seems that the current __filename module global is mainly used to
determine the directory the current module is in. To make that
easier, this patch adds support for a __dirname module global
directly.
15 years ago
isaacs
4dcdfaf929
Fix require("../blah") issues
Added some more tests, and refactored the uri and path modules to use the
same normalization logic, so that nothing is relying on flaky regexps.
http://groups.google.com/group/nodejs/browse_thread/thread/34779f8c10098c5e
http://groups.google.com/group/nodejs/browse_thread/thread/1aa0146b92582679#msg_9822c03998cb4064
15 years ago
Ryan Dahl
bfa36136da
require() should throw error if module does.
Reported by Kris Zyp
http://groups.google.com/group/nodejs/browse_thread/thread/1feab0309bd5402b
15 years ago
Felix Geisendörfer
530328f12b
CommonJS testing for node.js
Refactored test suite to use the assert module for testing rather than
mjsunit.
15 years ago
Felix Geisendörfer
43d651daef
The return of relative module loading
15 years ago
Felix Geisendörfer
7069bee982
The return of absolute Module loading
15 years ago
Ryan Dahl
7a2e784ad7
Module refactor - almost CommonJS compatible now
API change summary:
* require("/sys.js") becomes require("sys")
* require("circle.js") becomes require("./circle")
* process.path.join() becomes require("path").join()
15 years ago
Ryan Dahl
ad0a4cefb8
Namespace EVERYTHING under process; introduce GLOBAL
http://groups.google.com/group/nodejs/browse_thread/thread/1034fd2ad2cd93e8
15 years ago
Ryan Dahl
8185e1fd25
Remove include() add node.mixin()
include() should not be used by libraries because it will pollute the global
namespace. To discourage this behavior and bring Node more in-line with
the current CommonJS module system, include() is removed.
Small scripts like unit tests often times do want to pollute the global
namespace for ease. To avoid the boiler plate code of
var x = require("/x.js");
var foo = x.foo;
var bar = x.bar;
The function node.mixin() is stolen from jQuery's jQuery.extend. So that it
can be written:
node.mixin(require("/x.js"));
Reference:
http://docs.jquery.com/Utilities/jQuery.extend
http://groups.google.com/group/nodejs/browse_thread/thread/f9ac83e5c11e7e87
15 years ago
Ryan Dahl
7abad8b7b3
API: Move node.puts(), node.exec() and others to /utils.js
15 years ago
Ryan Dahl
4b8f503fac
Move mjsunit.js to system module directory.
15 years ago
Ryan Dahl
c8b143bf30
Absolute path names for require() refer to node.libraryPaths
15 years ago
Ryan
723c7d9f7c
Replace onExit() with process.addListener("exit")
- Update documentation.
- Depreciation message for onExit().
16 years ago
Ryan
31265be4a6
Depreciate onLoad
16 years ago
Ryan
3fed1a0954
Use v8's test runner
16 years ago
Ryan
8b49cef10b
Modify the tests to use onExit hook.
No need to rely on stdout output now.
onExit callbacks should print stack trace from onExit failure
16 years ago
Ryan
f6a7fe2657
Implement onExit() hook for modules.
onExit() is similar to the onLoad() callback. onExit() is called on each
module just before the process exits. This can be used to check state in
unit tests, but not to perform I/O. The process will forcibly exit as soon
as all of the onExit callbacks are made.
16 years ago
Ryan
b6fe4aec50
Module system refactor
There is one major API change in the refactor: filename extensions are now
required when requiring or including modules.
Added extra test to test-module-loading.js.
16 years ago