0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-module-loading-error.js
isaacs 3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00

36 lines
733 B
JavaScript

var common = require('../common');
var assert = require('assert');
common.debug('load test-module-loading-error.js');
var error_desc = {
win32: '%1 is not a valid Win32 application',
linux: 'file too short',
sunos: 'unknown file type'
};
var dlerror_msg = error_desc[process.platform];
if (!dlerror_msg) {
console.error('Skipping test, platform not supported.');
process.exit();
}
try {
require('../fixtures/module-loading-error.node');
} catch (e) {
assert.notEqual(e.toString().indexOf(dlerror_msg), -1);
}
try {
require();
} catch (e) {
assert.notEqual(e.toString().indexOf('missing path'), -1);
}
try {
require({});
} catch (e) {
assert.notEqual(e.toString().indexOf('path must be a string'), -1);
}