'use strict';
const cli = require('../../lib/cli'),
  assert = require('assert');

let path = 'http://0.0.0.0:8282/timings/';

let resultStructure = {
coachAdvice:
   { results:
      { accessibility: [Object],
        bestpractice: [Object],
        info: [Object],
        performance: [Object],
        timings: [Object],
        score: 94 },
     errors: {},
     url: 'https://www.sitespeed.io/',
     version: '0.2.0' }
   };

describe('Cli', function() {
   this.timeout(15000);
  it('The result should have the right structure  ', function() {
    const options = {url:'https://www.sitespeed.io', browser: 'firefox'};

    return cli.runDOMAndHar(options).then((result) =>
    {
        console.log(result);
        assert.strictEqual(Object.keys(result).length,1)
        assert.strictEqual(Object.keys(result.coachAdvice).length, 4);
        assert.strictEqual(Object.keys(result.coachAdvice.results).length, 6, 'The results should have six children: accessibility, bestpractice, info, performance, timings & score');
    });
  });
});

@@ -124,32 +124,318 @@
 ';%0A%0A
-let resultStructure = %7B%0A
+describe('Cli', function() %7B%0A   this.timeout(15000);%0A  it('The merged result should have the right structure from runDomAndHar ', function() %7B%0A    const options = %7Burl:path, browser: 'firefox'%7D;%0A%0A    return cli.runDOMAndHar(options).then((result) =%3E%0A    %7B%0A      /* The current structure looks like this:%0A      
 coac
@@ -443,16 +443,22 @@
 Advice:%0A
+      
    %7B res
@@ -463,16 +463,22 @@
 esults:%0A
+      
       %7B 
@@ -510,16 +510,22 @@
         
+      
 bestprac
@@ -548,16 +548,22 @@
         
+      
 info: %5BO
@@ -578,16 +578,22 @@
         
+  
+    
 performa
@@ -615,16 +615,22 @@
         
+   
+   
 timings:
@@ -648,16 +648,22 @@
         
+    
+  
 score: 9
@@ -667,16 +667,22 @@
 : 94 %7D,%0A
+      
      err
@@ -690,16 +690,22 @@
 rs: %7B%7D,%0A
+      
      url
@@ -735,16 +735,22 @@
 d.io/',%0A
+      
      ver
@@ -772,64 +772,341 @@
 %0A   
-%7D;%0A%0Adescribe('Cli', function() %7B%0A   this.timeout(15000);
+   */%0A%0A        assert.strictEqual(Object.keys(result).length,1)%0A        assert.strictEqual(Object.keys(result.coachAdvice).length, 4);%0A        assert.strictEqual(Object.keys(result.coachAdvice.results).length, 6, 'The results should have six children: accessibility, bestpractice, info, performance, timings & score');%0A    %7D);%0A  %7D);%0A
 %0A  i
@@ -1108,24 +1108,25 @@
 %0A%0A  it('The 
+ 
 result shoul
@@ -1152,16 +1152,27 @@
 ructure 
+from runHAR
  ', func
@@ -1205,58 +1205,50 @@
  = %7B
-url:'https://www.sitespeed.io', browser: 'firefox'
+file:'test/har/files/assetsRedirects.har' 
 %7D;%0A%0A
@@ -1261,33 +1261,27 @@
 turn cli.run
-DOMAndHar
+HAR
 (options).th
@@ -1311,30 +1311,166 @@
     
-  console.log(result);
+/* The current structure looks like this:%0A      coachAdvice:%0A         %7B results:%0A            %7B performance: %5BObject%5D %7D%0A           version: '0.2.0' %7D%0A      */%0A
 %0A   
@@ -1503,32 +1503,35 @@
 ject.keys(result
+%5B0%5D
 ).length,1)%0A    
@@ -1563,32 +1563,35 @@
 ject.keys(result
+%5B0%5D
 .coachAdvice).le
@@ -1588,33 +1588,33 @@
 Advice).length, 
-4
+2
 );%0A        asser
@@ -1637,32 +1637,35 @@
 ject.keys(result
+%5B0%5D
 .coachAdvice.res
@@ -1670,33 +1670,33 @@
 esults).length, 
-6
+1
 , 'The results s

test the runHar method