mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
ESLintify Part 2 (#841)
* ESLintify Part 2 * Fix * Fix tests * Fix tests * Fix tests
This commit is contained in:
parent
4267337fb0
commit
5ac2cee658
42 changed files with 188 additions and 190 deletions
|
@ -15,6 +15,7 @@ const shell = require('shelljs');
|
|||
const CWD = process.cwd();
|
||||
|
||||
const utils = require('../server/utils');
|
||||
|
||||
const siteConfig = require(CWD + '/website/siteConfig.js');
|
||||
const buildDir = CWD + '/website/build';
|
||||
const docsDir = CWD + '/docs';
|
||||
|
@ -67,11 +68,9 @@ describe('Build files', () => {
|
|||
});
|
||||
|
||||
test('Generated HTML for each Markdown resource', function() {
|
||||
let metadata = [];
|
||||
outputHTMLFiles.forEach(function(file) {
|
||||
const path = filepath.create(file);
|
||||
metadata.push(path.basename());
|
||||
});
|
||||
const metadata = outputHTMLFiles.map(file =>
|
||||
filepath.create(file).basename()
|
||||
);
|
||||
inputMarkdownFiles.forEach(function(file) {
|
||||
const data = fs.readFileSync(file, 'utf8');
|
||||
const frontmatter = fm(data);
|
||||
|
@ -105,11 +104,9 @@ describe('Build files', () => {
|
|||
});
|
||||
|
||||
test('Copied assets from /docs/assets', function() {
|
||||
let metadata = [];
|
||||
outputAssetsFiles.forEach(function(file) {
|
||||
const path = filepath.create(file);
|
||||
metadata.push(path.basename());
|
||||
});
|
||||
const metadata = outputAssetsFiles.map(file =>
|
||||
filepath.create(file).basename()
|
||||
);
|
||||
inputAssetsFiles.forEach(function(file) {
|
||||
const path = filepath.create(file);
|
||||
expect(metadata).toContain(path.basename());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue