Skip to content

Commit

Permalink
update variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
J Blaut committed Jun 8, 2020
1 parent 326b10b commit 033db4d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions scripts/linkeySetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@ fs.readdir(dir, (err, files) => {
}

return files.forEach(configFileName => {
const fileName = configFileName.split('.');
const serviceName = configFileName.split('.')[0];
const serviceTestFile = `${dir}/${serviceName}.test.js`;

const importConfig = `import { service } from './${fileName[0]}';\n`;
const testFile = fs.readFileSync('scripts/linkeyTest.js', (error, data) => {
return data;
});

if (excludes.indexOf(fileName[0]) >= 0) {
if (excludes.indexOf(serviceName) >= 0) {
return null;
}

const importConfig = `import { service } from './${serviceName}';\n`;
const testTemplate = fs.readFileSync(
'scripts/linkeyTest.js',
(error, data) => {
return data;
},
);

return fs.writeFile(
`${dir}/${fileName[0]}.test.js`,
importConfig + testFile,
serviceTestFile,
importConfig + testTemplate,
'utf8',
error => {
if (error) throw error;
Expand Down

0 comments on commit 033db4d

Please sign in to comment.