Codacy style changes for test files

This commit is contained in:
Angelos Chalaris
2018-08-02 13:49:33 +03:00
parent 067447bdfa
commit f0db074807
338 changed files with 2283 additions and 2619 deletions

View File

@ -52,15 +52,15 @@ snippetFiles
const fileFunction = fileCode
.split('\n')
.map(line => line)
.filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]).concat('');
.filter((_, i) => blockMarkers[0] < i && i < blockMarkers[1]);
// Grab snippet example based on code markers
const fileExample = fileCode
.split('\n')
.map(line => line)
.filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]).concat('');
.filter((_, i) => blockMarkers[2] < i && i < blockMarkers[3]);
// Export template for snippetName.js
const exportFile = `${fileFunction.join('\n')}\nmodule.exports = ${fileName};`.trim();
const exportFile = `${fileFunction.join('\n')}\nmodule.exports = ${fileName};\n`;
// Export template for snippetName.test.js which generates a example test & other information
const exportTest = [
@ -68,7 +68,7 @@ snippetFiles
`const ${fileName} = require('./${fileName}.js');`,
`\ntest('${fileName} is a Function', () => {`,
` expect(${fileName}).toBeInstanceOf(Function);`,
`});`
`});\n`
].join('\n');
// Write/Update exportFile which is snippetName.js in respective dir