Scan all descending directories for index.js with 'create index'; (fixes #2)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
expect
|
||||
} from 'chai';
|
||||
|
||||
import path from 'path';
|
||||
import glob from 'glob';
|
||||
import findIndexFiles from './../src/utilities/findIndexFiles';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './../../fixtures/find-index-files');
|
||||
|
||||
describe('findIndexFiles()', () => {
|
||||
it('finds only the directories that have an existing valid index file', () => {
|
||||
let names;
|
||||
|
||||
names = findIndexFiles(path.resolve(fixturesPath));
|
||||
names = names.sort();
|
||||
|
||||
expect(names).to.deep.equal(glob.sync(path.resolve(fixturesPath, './**/find-*')));
|
||||
});
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
-1
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
-1
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
-1
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -1 +0,0 @@
|
||||
'create index';
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import path from 'path';
|
||||
import readDirectory from './../src/utilities/readDirectory';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/read-directory');
|
||||
const fixturesPath = path.resolve(__dirname, './../../fixtures/read-directory');
|
||||
|
||||
describe('readDirectory()', () => {
|
||||
context('target directory contains child directories', () => {
|
||||
@@ -35,7 +35,7 @@ describe('readDirectory()', () => {
|
||||
expect(names).to.deep.equal(['present']);
|
||||
});
|
||||
});
|
||||
context.skip('target directory contains ./index.js', () => {
|
||||
context('target directory contains ./index.js', () => {
|
||||
it('does not include ./index.js', () => {
|
||||
let names;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import path from 'path';
|
||||
import validateTargetDirectory from './../src/utilities/validateTargetDirectory';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/validate-target-directory');
|
||||
const fixturesPath = path.resolve(__dirname, './../../fixtures/validate-target-directory');
|
||||
|
||||
describe('validateTargetDirectory()', () => {
|
||||
describe('directory path', () => {
|
||||
@@ -31,7 +31,7 @@ describe('validateTargetDirectory()', () => {
|
||||
expect(validateTargetDirectory(path.resolve(fixturesPath, 'no-index'))).to.equal(true);
|
||||
});
|
||||
});
|
||||
context.skip('safe', () => {
|
||||
context('safe', () => {
|
||||
it('returns true', () => {
|
||||
expect(validateTargetDirectory(path.resolve(fixturesPath, 'safe-index'))).to.equal(true);
|
||||
});
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import path from 'path';
|
||||
import codeExample from './codeExample';
|
||||
import writeIndex from './../src/utilities/writeIndex';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/write-index');
|
||||
const fixturesPath = path.resolve(__dirname, './../../fixtures/write-index');
|
||||
|
||||
describe('writeIndex()', () => {
|
||||
it('creates index in target directory', () => {
|
||||
|
||||
Reference in New Issue
Block a user