var assert = require('assert');
var expect = require('chai').expect;

var Remote = require('../lib/remote');
var HTTP = require('../lib/http');

var server = new HTTP();
var index = '/';

describe('Remote', function () {
  before(async function () {
    await server.start();
  });

  after(async function () {
    await server.stop();
  });

  it('should expose a constructor', function () {
    assert.equal(typeof Remote, 'function');
  });

  it('can emulate HTTP GET', async function () {
    var remote = new Remote({
      host: 'localhost:3000',
      secure: false
    });
    var result = await remote._GET(index);

    assert.ok(result);
  });

  it('can emulate HTTP OPTIONS', async function () {
    var remote = new Remote({
      host: 'localhost:3000',
      secure: false
    });
    var result = await remote._OPTIONS(index);

    assert.ok(result);
  });

});

@@ -142,33 +142,8 @@
 );%0A%0A
-var server = new HTTP();%0A
 var 
@@ -193,130 +193,8 @@
 ) %7B%0A
-  before(async function () %7B%0A    await server.start();%0A  %7D);%0A%0A  after(async function () %7B%0A    await server.stop();%0A  %7D);%0A%0A
   it
@@ -336,35 +336,64 @@
 nction () %7B%0A    
-var
+let server = new HTTP();%0A    let
  remote = new Re
@@ -449,39 +449,67 @@
 : false%0A    %7D);%0A
+%0A
     
-var
+await server.start();%0A%0A    let
  result = await 
@@ -521,32 +521,58 @@
 e._GET(index);%0A%0A
+    await server.stop();%0A%0A
     assert.ok(re
@@ -642,19 +642,48 @@
 ) %7B%0A    
-var
+let server = new HTTP();%0A    let
  remote 
@@ -759,15 +759,47 @@
 %7D);%0A
+%0A
     
-var
+await server.start();%0A    %0A    let
  res
@@ -831,24 +831,50 @@
 NS(index);%0A%0A
+    await server.stop();%0A%0A
     assert.o

Clean up Remote tests