dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/rcfinder/test/get.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

25 lines
No EOL
690 B
JavaScript

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);
});
});