var ACME = require( '..' )
var assert = require( 'assert' )
var nock = require( 'nock' )

suite( 'ACME', function() {

  var acme = new ACME({
    baseUrl: 'https://mock_encrypt.example.com',
  })

  test( 'throws an error if baseUrl is not a string', function() {
    assert.throws( function() {
      new ACME({ baseUrl: 42 })
    })


    assert.throws( function() {
      new ACME({ baseUrl: {} })
    })
  })

  test( '#getDirectory()', function( next ) {
    var payload = {
      'new-authz': 'https://mock_encrypt.example.com/acme/new-authz',
      'new-cert': 'https://mock_encrypt.example.com/acme/new-cert',
      'new-reg': 'https://mock_encrypt.example.com/acme/new-reg',
      'revoke-cert': 'https://mock_encrypt.example.com/acme/revoke-cert'
    }

    nock( 'https://mock_encrypt.example.com' )
      .get( '/directory' )
      .reply( 200, payload )

    acme.getDirectory( function( error, data ) {
      assert.ifError( error )
      assert.ok( data )
      assert.deepStrictEqual( payload, data )
      next()
    })
  })

})

@@ -118,20 +118,22 @@
 %0A%0A  var 
-acme
+client
  = new A
@@ -156,36 +156,27 @@
 l: 'https://
-mock_encrypt
+api
 .example.com
@@ -274,38 +274,32 @@
 ws( function() %7B
-%0A     
  new ACME(%7B base
@@ -312,18 +312,12 @@
 2 %7D)
-%0A   
  %7D)%0A
-%0A%0A
     
@@ -343,22 +343,16 @@
 tion() %7B
-%0A     
  new ACM
@@ -369,20 +369,16 @@
 l: %7B%7D %7D)
-%0A   
  %7D)%0A  %7D)
@@ -421,24 +421,25 @@
 n( next ) %7B%0A
+%0A
     var payl
@@ -470,36 +470,27 @@
 ': 'https://
-mock_encrypt
+api
 .example.com
@@ -530,36 +530,27 @@
 ': 'https://
-mock_encrypt
+api
 .example.com
@@ -588,36 +588,27 @@
 ': 'https://
-mock_encrypt
+api
 .example.com
@@ -649,36 +649,27 @@
 ': 'https://
-mock_encrypt
+api
 .example.com
@@ -717,20 +717,11 @@
 s://
-mock_encrypt
+api
 .exa
@@ -793,20 +793,22 @@
  )%0A%0A    
-acme
+client
 .getDire
@@ -956,21 +956,22 @@
 xt()%0A    %7D)%0A
+%0A
   %7D)%0A%0A%7D)%0A

Update test: Simplify, compact formatting