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

describe('makeLicense', function () {
  var makeLicense; 
  var result;
  var stub = {
    'inquirer' :{
      prompt: function() {
        return new Promise(function(resolve, reject) {
          
          return resolve({years: 'foo',name: 'bar'});
        });
      },
     
    },
    './print': function(license) {} 
  };
  it('should raise error when no match for license', function (done) {
    var args = {license: 'blahblahblah'};
    makeLicense = proxyquire('../dist/make-license.js', stub).default
    expect(makeLicense.bind(makeLicense,args)).to.throw(Error);
    done();
  });

  it('should exist', function (done) {
    expect(makeLicense).to.exist;
    done();
  });
  const tests = [
    {
      license: "MIT",
      text: 'Permission is hereby granted, free of charge, to any person obtaining a copy'
    },
    {
      license: "ISC",
      text: 'Permission to use, copy, modify, and/or distribute this software for any'
    },
    {
      license: "BSD 2",
      text: 'Redistribution and use in source and binary forms, with or without'
    },
    {
      license: "BSD 3",
      text: 'this software without specific prior written permission.'
    },
    {
      license: "Apache 2.0",
      text: 'Licensed under the Apache License'
    },
    {
      license: "GPL-3.0",
      text: 'GNU GENERAL PUBLIC LICENSE'
    },
  ].forEach(function(test) {
    it('should print license when given license name: ' + test.license, function(done) {
      var args = {license: test.license};
      stub['./print'] = function(license) {
        expect(license).to.contain(test.text)
        done();
      }
      makeLicense = proxyquire('../dist/make-license.js', stub).default
      expect(makeLicense.bind(makeLicense, args)).not.to.throw(Error);
    })
  })
  
});

@@ -126,18 +126,17 @@
 License;
- 
 %0A
+
   var re
@@ -256,26 +256,16 @@
 ject) %7B%0A
-          
 %0A       
@@ -296,16 +296,17 @@
 : 'foo',
+ 
 name: 'b
@@ -337,14 +337,9 @@
  %7D,%0A
-     
 %0A
+
     
@@ -380,15 +380,16 @@
 ) %7B%7D
- 
 %0A  %7D;%0A
+%0A%0A
   it
@@ -741,16 +741,17 @@
 ;%0A  %7D);%0A
+%0A
   const 
@@ -785,13 +785,13 @@
 se: 
-%22MIT%22
+'MIT'
 ,%0A  
@@ -911,13 +911,13 @@
 se: 
-%22ISC%22
+'ISC'
 ,%0A  
@@ -1033,15 +1033,15 @@
 se: 
-%22
+'
 BSD 2
-%22
+'
 ,%0A  
@@ -1151,15 +1151,15 @@
 se: 
-%22
+'
 BSD 3
-%22
+'
 ,%0A  
@@ -1255,17 +1255,17 @@
 icense: 
-%22
+'
 Apache 2
@@ -1266,17 +1266,17 @@
 ache 2.0
-%22
+'
 ,%0A      
@@ -1349,17 +1349,17 @@
 se: 
-%22
+'
 GPL-3.0
-%22
+'
 ,%0A  
@@ -1404,16 +1404,223 @@
 %0A    %7D,%0A
+    %7B%0A      license: 'NO LICENSE',%0A      text: 'Copyright (c) foo, bar%5Cn'%0A    %7D,%0A    %7B%0A      license: 'UNLICENSE',%0A      text: 'This is free and unencumbered software released into the public domain.'%0A    %7D%0A
   %5D.forE
@@ -2040,15 +2040,13 @@
 %7D)%0A  %7D)%0A
-  
 %0A%7D);%0A

Add tests for 'NO LICENSE' and 'UNLICENSE'