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

describe("Testing 'strict' option", function(){
    var dupkeys = '{ "dupkey": "value 1", "dupkey": "value 2"}';
    it("Should show that duplicate keys just get overwritten by default", function(done){
        var JSONbig = require('../index');
        var result = "before";
        function tryParse() {
            result = JSONbig.parse(dupkeys);
        }
        expect(tryParse).to.not.throw("anything");
        expect(result.dupkey).to.equal("value 2");
        done();
    });

    it("Should show that the 'strict' option will fail-fast on duplicate keys", function(done){
        var JSONstrict = require('../index')({"strict": true});
        var result = "before";
        function tryParse() {
            result = JSONstrict.parse(dupkeys);
        }
        expect(tryParse).to.throw({ 
            name: 'SyntaxError',
            message: 'Duplicate key "dupkey"',
            at: 33,
            text: '{ "dupkey": "value 1", "dupkey": "value 2"}' 
        });
        expect(result).to.equal("before");
        done();
    });
});

@@ -3,17 +3,16 @@
 r mocha 
- 
 = requir
@@ -21,20 +21,19 @@
 'mocha')
+,
 %0A 
- ,
  assert 
@@ -60,12 +60,11 @@
 sert
+,
 %0A 
- ,
  exp
@@ -95,13 +95,9 @@
 pect
-%0A  ;%0A
+;
 %0Ades
@@ -141,14 +141,14 @@
 tion
+ 
 ()
+ 
 %7B%0A
-  
   va
@@ -206,24 +206,22 @@
 e 2%22%7D';%0A
-  
   it(
-%22
+'
 Should s
@@ -275,17 +275,17 @@
  default
-%22
+'
 , functi
@@ -282,36 +282,34 @@
 t', function
+ 
 (done)
+ 
 %7B%0A
-    
     var JSON
@@ -335,20 +335,16 @@
 ndex');%0A
-    
     var 
@@ -348,38 +348,34 @@
 ar result = 
-%22
+'
 before
-%22
+'
 ;%0A
-    
     function
@@ -380,38 +380,32 @@
 on tryParse() %7B%0A
-      
       result = J
@@ -427,34 +427,26 @@
 pkeys);%0A    
-    %7D%0A    
+%7D%0A
     expect(t
@@ -471,17 +471,17 @@
 row(
-%22
+'
 anything
 %22);%0A
@@ -476,24 +476,20 @@
 anything
-%22
+'
 );%0A
-    
     expe
@@ -519,28 +519,24 @@
 ual(
-%22
+'
 value 2
-%22
+'
 );%0A    
- 
-   
 done
@@ -545,17 +545,13 @@
 ;%0A  
- 
- 
 %7D);%0A%0A
-  
   it
@@ -636,20 +636,18 @@
 tion
+ 
 (done)
+ 
 %7B%0A
-    
     
@@ -688,30 +688,30 @@
 ')(%7B
-%22
+ 
 strict
-%22
 : true
+ 
 %7D);%0A    
     
@@ -706,20 +706,16 @@
 %7D);%0A    
- 
-   
 var resu
@@ -723,22 +723,18 @@
 t = 
-%22
+'
 before
-%22
+'
 ;%0A
-    
     
@@ -761,22 +761,16 @@
 %7B%0A      
-  
-    
 result =
@@ -801,22 +801,15 @@
 s);%0A
-    
     %7D%0A
-    
+%0A
     
@@ -838,192 +838,35 @@
 row(
-%7B %0A            name: 'SyntaxError',%0A            message: 'Duplicate key %22dupkey%22',%0A            at: 33,%0A            text: '%7B %22dupkey%22: %22value 1%22, %22dupkey%22: %22value 2%22%7D' %0A        %7D);%0A    
+'Duplicate key %22dupkey%22');%0A
     
@@ -893,23 +893,19 @@
 ual(
-%22
+'
 before
-%22
+'
 );%0A
-    
     
@@ -912,18 +912,16 @@
 done();%0A
-  
   %7D);%0A%7D)

fix assertion after chai upgrade