import {expect} from 'chai';
import jsdom from 'jsdom';
import fs from 'fs';

describe('Our first test', () => {
  it('should pass', () => {
    expect(true).to.equal(true);
  });
});

it('has document', function () {
  const html = '<!doctype html><html><body></body></html>';
  global.document = jsdom.env(html, function(err, window) {
    var div = window.document.createElement('div');
    expect(div.nodeName).eql('DIV');
    // free memory associated with the window
    window.close();
  });
});

describe('jsdom test', () => {
  it('should pass', (done) => {
    const index = fs.readFileSync('./src/index.html', "utf-8");
    jsdom.env(index, function (err, window) {
      const h2 = window.document.getElementById('main-heading');
      expect(h2.innerHTML).to.equal("Fuel Savings Calculator");
      done();
      // free memory associated with the window
      window.close();
    });
  });
});

@@ -69,16 +69,45 @@
 om 'fs';
+%0Aimport index from './index';
 %0A%0Adescri
@@ -604,16 +604,20 @@
 st index
+Html
  = fs.re
@@ -676,16 +676,29 @@
 nv(index
+Html, %5Bindex%5D
 , functi

Fix jsdom test