Skip to content
Permalink
Browse files

test(generic): add tests for the require-search util

  • Loading branch information
MarshallOfSound committed Dec 29, 2016
1 parent bdaff3c commit b7930eaa18be82e0940ec22519ee6c9a37d87193
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/util_spec.js
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import path from 'path';

import requireSearch from '../src/util/require-search';
import resolveDir from '../src/util/resolve-dir';
import findConfig from '../src/util/forge-config';

@@ -48,3 +49,15 @@ describe('forge-config', () => {
expect(conf.magicFn()).to.be.equal('magic result');
});
});

describe.only('require-search', () => {
it('should resolve undefined if no file exists', () => {
const resolved = requireSearch(__dirname, ['../src/util/wizard-secrets']);
expect(resolved).to.equal(undefined);
});

it('should resolve a file if it exists', () => {
const resolved = requireSearch(__dirname, ['../src/util/forge-config']);
expect(resolved).to.equal(findConfig);
});
});

0 comments on commit b7930ea

Please sign in to comment.
You can’t perform that action at this time.