@@ -16,8 +16,8 @@ puppeteer.use(AdblockerPlugin({ useCache: false }));
16
16
const config_file = process . argv . slice ( 2 ) [ 0 ]
17
17
? process . argv . slice ( 2 ) [ 0 ]
18
18
: new Error (
19
- 'File not specified as start param. Please inform the filename with its extension as --file in start script.'
20
- ) ;
19
+ 'File not specified as start param. Please inform the filename with its extension as --file in start script.'
20
+ ) ;
21
21
22
22
// Defining xlsx as default value.
23
23
let export_opt = 'xlsx' ;
@@ -33,7 +33,7 @@ if (process.argv.slice(2)[1] === 'xlsx') {
33
33
let filename = `${ __dirname } /results/results_${ new Date ( ) . getTime ( ) } .${ export_opt } ` ;
34
34
35
35
const configFile = require ( `./config/${ config_file } ` ) ;
36
- configFile . validator . forEach ( async ( config ) => {
36
+ configFile . validator . forEach ( async ( config ) => {
37
37
const schema = require ( `./schema/${ config . schema_name [ 0 ] } ` ) ;
38
38
// let startChromeInDebugMode = async () => {
39
39
// let operatingSystem = os.platform();
@@ -91,13 +91,9 @@ configFile.validator.forEach( async (config) => {
91
91
page . on ( 'load' , async ( ) => {
92
92
await page . waitFor ( 2000 ) ;
93
93
if ( page . url ( ) === config . url ) {
94
- await fs . appendFileSync (
95
- filename ,
96
- `Url validating: ${ page . url ( ) } \n` ,
97
- ( err ) => {
98
- if ( err ) throw err ;
99
- }
100
- ) ;
94
+ await fs . appendFileSync ( filename , `Url validating: ${ page . url ( ) } \n` , ( err ) => {
95
+ if ( err ) throw err ;
96
+ } ) ;
101
97
//doc.text(path, 10, 10);
102
98
await page . evaluate ( ( ) => {
103
99
//Validate first hits.
@@ -115,13 +111,9 @@ configFile.validator.forEach( async (config) => {
115
111
await browser . close ( ) ;
116
112
}
117
113
} else {
118
- await fs . appendFileSync (
119
- filename ,
120
- `Path : ${ page . url ( ) } \n` ,
121
- ( err ) => {
122
- if ( err ) throw err ;
123
- }
124
- ) ;
114
+ await fs . appendFileSync ( filename , `Path : ${ page . url ( ) } \n` , ( err ) => {
115
+ if ( err ) throw err ;
116
+ } ) ;
125
117
//doc.text(path, 10, 10);
126
118
}
127
119
} ) ;
@@ -131,7 +123,7 @@ configFile.validator.forEach( async (config) => {
131
123
132
124
await runAfterGTMDebug ( ) ;
133
125
134
- await fs . appendFile ( filename , '' , ( ) => { } ) ;
126
+ await fs . appendFile ( filename , '' , ( ) => { } ) ;
135
127
136
128
let cleanupEval = ( ) => {
137
129
console . log ( 'Realizing last eval' ) ;
@@ -156,4 +148,4 @@ configFile.validator.forEach( async (config) => {
156
148
157
149
await process . on ( 'exit' , cleanupEval ) ;
158
150
} ) ( ) ;
159
- } )
151
+ } ) ;
0 commit comments