2016-10-10 03:43:44 +02:00
|
|
|
var test = require('tape');
|
|
|
|
var resolve = require('../');
|
|
|
|
|
|
|
|
test('core modules', function (t) {
|
2017-05-28 00:38:50 +02:00
|
|
|
t.test('isCore()', function (st) {
|
|
|
|
st.ok(resolve.isCore('fs'));
|
|
|
|
st.ok(resolve.isCore('net'));
|
|
|
|
st.ok(resolve.isCore('http'));
|
|
|
|
|
|
|
|
st.ok(!resolve.isCore('seq'));
|
|
|
|
st.ok(!resolve.isCore('../'));
|
|
|
|
st.end();
|
|
|
|
});
|
|
|
|
|
|
|
|
t.test('core list', function (st) {
|
|
|
|
st.plan(resolve.core.length);
|
|
|
|
|
|
|
|
for (var i = 0; i < resolve.core.length; ++i) {
|
|
|
|
st.doesNotThrow(
|
|
|
|
function () { require(resolve.core[i]); }, // eslint-disable-line no-loop-func
|
|
|
|
'requiring ' + resolve.core[i] + ' does not throw'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
st.end();
|
|
|
|
});
|
|
|
|
|
2016-10-10 03:43:44 +02:00
|
|
|
t.end();
|
|
|
|
});
|