jest.autoMockOff()

describe('iso3166-1', function() {
  var iso3166

  beforeEach(function() {
    iso3166 = require('..')
  })

  it('has a `from` method', function() {
    return expect(typeof iso3166.from).toBe('function')
  })

  it('has a `fromLocale` method', function() {
    return expect(typeof iso3166.fromLocale).toBe('function')
  })

  it('has a `to2` method', function() {
    return expect(typeof iso3166.to2).toBe('function')
  })

  it('has a `to3` method', function() {
    return expect(typeof iso3166.to3).toBe('function')
  })

  it('converts an ISO3166-1 alpha-2 code to alpha-3', function() {
    return expect(iso3166.from('US').to3()).toBe('USA')
  })

  it('maintains an ISO3166-1 alpha-2 code to alpha-2', function() {
    return expect(iso3166.from('US').to2()).toBe('US')
  })

  it('converts an ISO3166-1 alpha-3 code to alpha-2', function() {
    return expect(iso3166.from('USA').to2()).toBe('US')
  })

  it('maintains an ISO3166-1 alpha-3 code to alpha-3', function() {
    return expect(iso3166.from('USA').to3()).toBe('USA')
  })

  it('converts a locale to ISO3166-1 alpha-2', function() {
    return expect(iso3166.fromLocale('en-US').to2()).toBe('US')
  })

  it('converts a locale to ISO3166-1 alpha-3', function() {
    return expect(iso3166.fromLocale('en-US').to3()).toBe('USA')
  })
})

@@ -133,27 +133,51 @@
 it('
-has a %60from%60 method
+should return an object when calling %60from%60
 ', f
@@ -184,39 +184,32 @@
 unction() %7B%0A    
-return 
 expect(typeof is
@@ -218,24 +218,30 @@
 166.from
+('US')
 ).toBe('
 function
@@ -228,32 +228,30 @@
 US')).toBe('
-function
+object
 ')%0A  %7D)%0A%0A  i
@@ -253,21 +253,52 @@
 %0A%0A  it('
-has a
+should return an object when calling
  %60fromLo
@@ -302,23 +302,16 @@
 mLocale%60
- method
 ', funct
@@ -314,39 +314,32 @@
 unction() %7B%0A    
-return 
 expect(typeof is
@@ -358,57 +358,89 @@
 cale
-).toBe('function')%0A  %7D)%0A%0A  it('has a %60to2%60 method
+('en-US')).toBe('object')%0A  %7D)%0A%0A  it('can call a function named %60to2%60 from %60from%60
 ', f
@@ -447,39 +447,32 @@
 unction() %7B%0A    
-return 
 expect(typeof is
@@ -477,16 +477,28 @@
 iso3166.
+from('USA').
 to2).toB
@@ -527,26 +527,51 @@
 it('
-has a %60to3%60 method
+can call a function named %60to3%60 from %60from%60
 ', f
@@ -582,31 +582,24 @@
 ion() %7B%0A    
-return 
 expect(typeo
@@ -608,16 +608,27 @@
 iso3166.
+from('US').
 to3).toB
@@ -710,39 +710,32 @@
 unction() %7B%0A    
-return 
 expect(iso3166.f
@@ -833,39 +833,32 @@
 unction() %7B%0A    
-return 
 expect(iso3166.f
@@ -954,39 +954,32 @@
 unction() %7B%0A    
-return 
 expect(iso3166.f
@@ -1077,39 +1077,32 @@
 unction() %7B%0A    
-return 
 expect(iso3166.f
@@ -1193,39 +1193,32 @@
 unction() %7B%0A    
-return 
 expect(iso3166.f
@@ -1324,23 +1324,16 @@
 ) %7B%0A    
-return 
 expect(i
@@ -1382,12 +1382,385 @@
 A')%0A  %7D)
+%0A%0A  it('directly converts an ISO3166-1 alpha-2 code to alpha-3', function() %7B%0A    expect(iso3166.to3('US')).toBe('USA')%0A  %7D)%0A%0A  it('directly converts an ISO3166-1 alpha-3 code to alpha-2', function() %7B%0A    expect(iso3166.to2('USA')).toBe('US')%0A  %7D)%0A%0A  it('returns a list of key/val pairs of country codes', function() %7B%0A    expect(typeof iso3166.list()).toBe('object')%0A  %7D)
 %0A%7D)%0A

add more tests