aboutsummaryrefslogtreecommitdiffstats
path: root/gentests.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-03 06:49:33 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-03 06:49:33 +0800
commita8f745f9fe74751b87f500af3857b66d4c80f45e (patch)
treef4f09d2b4227b35a6d2fd996113d36a8aa658ddd /gentests.js
parentcc11a623972acf707291d7b42d9dc2f8d7006e20 (diff)
downloadtangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.gz
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.bz2
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.lz
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.xz
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.zst
tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.zip
eslint --fix .
Diffstat (limited to 'gentests.js')
-rw-r--r--gentests.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/gentests.js b/gentests.js
index 08232e10f..8f31d8b67 100644
--- a/gentests.js
+++ b/gentests.js
@@ -27,11 +27,11 @@ async function getAllFileNames (dirName) {
async function start (fileRegEx, testGenerator) {
const fileNames = await getAllFileNames('./ui/app')
const sFiles = fileNames.filter(name => name.match(fileRegEx))
-
+
let sFileMethodNames
let testFilePath
async.each(sFiles, async (sFile, cb) => {
- let [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/)
+ const [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/)
sFileMethodNames = Object.keys(require(__dirname + '/' + sFile))
testFilePath = sPath.replace('.', '-').replace('.', '.test.')
@@ -44,25 +44,25 @@ async function start (fileRegEx, testGenerator) {
}, (err) => {
console.log(err)
})
-
+
}
async function startContainer (fileRegEx, testGenerator) {
const fileNames = await getAllFileNames('./ui/app')
const sFiles = fileNames.filter(name => name.match(fileRegEx))
-
+
let sFileMethodNames
async.each(sFiles, async (sFile, cb) => {
- console.log(`sFile`, sFile);
- let [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/)
-
- let testFilePath = sPath.replace('.', '-').replace('.', '.test.')
+ console.log(`sFile`, sFile)
+ const [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/)
+
+ const testFilePath = sPath.replace('.', '-').replace('.', '.test.')
await promisify(fs.readFile)(
__dirname + '/' + sFile,
'utf8',
async (err, result) => {
- console.log(`result`, result.length);
+ console.log(`result`, result.length)
const returnObjectStrings = result
.match(/return\s(\{[\s\S]+?})\n}/g)
.map(str => {
@@ -71,7 +71,7 @@ async function startContainer (fileRegEx, testGenerator) {
.slice(7)
.replace(/\n/g, '')
.replace(/\s\s+/g, ' ')
-
+
})
const mapStateToPropsAssertionObject = returnObjectStrings[0]
.replace(/\w+:\s\w+\([\w,\s]+\),/g, str => {
@@ -113,8 +113,8 @@ async function startContainer (fileRegEx, testGenerator) {
})
// console.log(`containerTest`, `${__dirname}/${sRootPath}tests/${testFilePath}`, containerTest);
console.log('----')
- console.log(`sRootPath`, sRootPath);
- console.log(`testFilePath`, testFilePath);
+ console.log(`sRootPath`, sRootPath)
+ console.log(`testFilePath`, testFilePath)
await promisify(fs.writeFile)(
`${__dirname}/${sRootPath}tests/${testFilePath}`,
containerTest,
@@ -125,11 +125,11 @@ async function startContainer (fileRegEx, testGenerator) {
}, (err) => {
console.log('123', err)
})
-
+
}
function generateMethodList (methodArray) {
- return methodArray.map(n => ' ' + n).join(',\n') + ','
+ return methodArray.map(n => ' ' + n).join(',\n') + ','
}
function generateMethodDescribeBlock (methodName, index) {
@@ -231,4 +231,4 @@ describe('${sPath.match(/^[^.]+/)} container', () => {
})
})`
-} \ No newline at end of file
+}