dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/rcfinder/test/get.js

25 lines
690 B
JavaScript
Raw Normal View History

2016-09-11 09:29:13 +01:00
describe('Finder#get', function () {
var RcFinder = require('../');
var join = require('path').join;
var expect = require('expect.js');
var fixtures = {
root: join(__dirname, 'fixtures/foo/foo/foo/foo/'),
json: join(__dirname, 'fixtures/foo/foo/bar.json'),
text: join(__dirname, 'fixtures/foo/foo/.baz'),
config: {
baz: 'bog'
}
};
it('uses the loader function to get a file', function () {
var football = {};
var rcFinder = new RcFinder('bar.json', {
loader: function (path) {
return football;
}
});
var config = rcFinder.get(join(__dirname, 'fixtures/foo/bar.json'));
expect(config).to.be(football);
});
});