fix: update dependencies

This commit is contained in:
Gajus Kuizinas
2020-05-18 10:11:25 -07:00
parent 017b834393
commit 76c6d4b5ee
24 changed files with 112 additions and 95 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "canonical/mocha"
}
+2 -2
View File
@@ -1,7 +1,7 @@
/* eslint-disable no-restricted-syntax */
import {
expect
expect,
} from 'chai';
import createIndexCode from '../src/utilities/createIndexCode';
import codeExample from './codeExample';
@@ -60,7 +60,7 @@ export { default as foo } from './foo';
context('with config', () => {
it('should append config', () => {
const config = {
ignore: ['/^zoo/']
ignore: ['/^zoo/'],
};
const indexCode = createIndexCode(['foo', 'bar'], {config});
+1 -1
View File
@@ -1,6 +1,6 @@
import path from 'path';
import {
expect
expect,
} from 'chai';
import glob from 'glob';
import findIndexFiles from '../src/utilities/findIndexFiles';
+5 -5
View File
@@ -1,6 +1,6 @@
import path from 'path';
import {
expect
expect,
} from 'chai';
import readDirectory from '../src/utilities/readDirectory';
@@ -71,7 +71,7 @@ describe('readDirectory()', () => {
});
context('target directory contains non js files, and allowing only jsx', () => {
it('prefers file', () => {
const options = { extensions: ['jsx'] };
const options = {extensions: ['jsx']};
const names = readDirectory(path.resolve(fixturesPath, 'children-files-alt-extension'), options);
expect(names).to.deep.equal(['bar.jsx']);
@@ -79,7 +79,7 @@ describe('readDirectory()', () => {
});
context('target directory contains non js files, and allowing both js and jsx', () => {
it('prefers file', () => {
const options = { extensions: ['js', 'jsx'] };
const options = {extensions: ['js', 'jsx']};
const names = readDirectory(path.resolve(fixturesPath, 'children-files-alt-extension'), options);
expect(names).to.deep.equal(['bar.jsx', 'present.js']);
@@ -87,7 +87,7 @@ describe('readDirectory()', () => {
});
context('target directory contains homonyms files, and allowing both js and jsx, will prefer JS as it is first extension listed', () => {
it('prefers file', () => {
const options = { extensions: ['js', 'jsx'] };
const options = {extensions: ['js', 'jsx']};
const names = readDirectory(path.resolve(fixturesPath, 'children-files-alt-extension-with-homonyms'), options);
expect(names).to.deep.equal(['bar.js', 'present.js']);
@@ -95,7 +95,7 @@ describe('readDirectory()', () => {
});
context('target directory contains homonyms files, and allowing both js and jsx, will prefer JSX as it is first extension listed', () => {
it('prefers file', () => {
const options = { extensions: ['jsx', 'js'] };
const options = {extensions: ['jsx', 'js']};
const names = readDirectory(path.resolve(fixturesPath, 'children-files-alt-extension-with-homonyms'), options);
expect(names).to.deep.equal(['bar.jsx', 'present.js']);
+4 -4
View File
@@ -1,6 +1,6 @@
import path from 'path';
import {
expect
expect,
} from 'chai';
import readIndexConfig from '../src/utilities/readIndexConfig';
@@ -8,15 +8,15 @@ const fixtures = {
noIndex: path.resolve(__dirname, 'fixtures/read-index-config/no-index'),
withConfig: path.resolve(__dirname, 'fixtures/read-index-config/with-config'),
withInvalidConfig: path.resolve(__dirname, 'fixtures/read-index-config/with-invalid-config'),
withoutConfig: path.resolve(__dirname, 'fixtures/read-index-config/without-config')
withoutConfig: path.resolve(__dirname, 'fixtures/read-index-config/without-config'),
};
const expectedValues = {
noIndex: {},
withConfig: {
ignore: ['/foo.js$/']
ignore: ['/foo.js$/'],
},
withoutConfig: {}
withoutConfig: {},
};
describe('readIndexConfig()', () => {
+3 -3
View File
@@ -1,7 +1,7 @@
import {
expect
expect,
} from 'chai';
import sortByDepth from './../src/utilities/sortByDepth';
import sortByDepth from '../src/utilities/sortByDepth';
describe('sortByDepth()', () => {
it('sorts from deepest to the most shallow', () => {
@@ -9,7 +9,7 @@ describe('sortByDepth()', () => {
'/b',
'/a',
'/a/b/c',
'/a/b'
'/a/b',
];
const sortedPaths = sortByDepth(paths);
+1 -1
View File
@@ -2,7 +2,7 @@
import path from 'path';
import {
expect
expect,
} from 'chai';
import validateTargetDirectory from '../src/utilities/validateTargetDirectory';
+2 -2
View File
@@ -3,7 +3,7 @@
import fs from 'fs';
import path from 'path';
import {
expect
expect,
} from 'chai';
import writeIndex from '../src/utilities/writeIndex';
import codeExample from './codeExample';
@@ -40,7 +40,7 @@ export { default as foo } from './foo.js';
it('creates index with config in target directory', () => {
const indexFilePath = path.resolve(fixturesPath, 'with-config/index.js');
// eslint-disable-next-line
// eslint-disable-next-line quotes
const ignoredExportLine = `export { default as bar } from './bar.js';`;
appendToFile(indexFilePath, ignoredExportLine);