-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tests): testing and clean up from developer mistakes
- Loading branch information
Showing
34 changed files
with
1,450 additions
and
1,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"timeout": 7000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const flows = {} | ||
|
||
// Recursive function to read subfolders and files | ||
function readSubfoldersAndFiles (directory) { | ||
fs.readdirSync(directory).forEach(file => { | ||
const fullPath = path.join('./', directory, file) | ||
if (fs.lstatSync(fullPath).isDirectory()) { | ||
readSubfoldersAndFiles(fullPath) | ||
} else { | ||
if (path.extname(fullPath) === '.js' && fullPath.indexOf('flows') !== -1) { | ||
flows[fullPath] = require('./' + fullPath) | ||
} | ||
} | ||
}) | ||
} | ||
|
||
// convert Object to JSON formatted string | ||
function formatJSON (obj) { | ||
for (const data in obj) { | ||
obj[data] = JSON.parse(JSON.stringify(obj[data])) | ||
} | ||
return obj | ||
} | ||
|
||
readSubfoldersAndFiles('./test') | ||
// console.log(flows); | ||
|
||
for (const flowEntry in flows) { | ||
console.log(flowEntry) | ||
const flowData = require('./' + flowEntry) | ||
|
||
for (const flow in flowData) { | ||
flowData[flow] = formatJSON(flowData[flow]) | ||
} | ||
|
||
// console.log(flowData); | ||
} | ||
|
||
// console.log(flows); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.