/* global it, describe */

import caseDash from '../case-dash';
import assert from 'assert';

describe('case-dash', function () {
  const tests = [
      ['T', ['T']],
      ['t', ['t']],
      ['Test', ['Test']],
      ['test', ['test']],
      ['this-Is-A-Test', ['this', 'Is', 'A', 'Test']],
      ['This-Is-A-Test', ['This', 'Is', 'A', 'Test']],
      ['THIS-Is-A-Test', ['THIS', 'Is', 'A', 'Test']]
    ]

  describe('#parse()', function () {
    tests.forEach(function (pair) {
      var name = pair[0],
        parsed = pair[1]

      it(JSON.stringify(name) + ' -> ' + JSON.stringify(parsed), function () {
        assert.deepEqual(caseDash.parse(name), parsed)
      })
    })
  })

  describe('#stringify()', function () {
    tests.forEach(function (pair) {
      var name = pair[0],
        parsed = pair[1]

      it(JSON.stringify(parsed) + ' -> ' + JSON.stringify(name), function () {
        assert.equal(caseDash.stringify(parsed), name)
      })
    })
  })

  describe('#is()', function () {
    tests.forEach(function (pair) {
      var name1 = pair[0],
        parsed = pair[1],
        name2 = pair[1].join('#'),
        val1 = parsed.length > 1

      it(JSON.stringify(name1) + ' (' + val1 + ')', function () {
        assert.equal(caseDash.is(name1), val1)
      })
      it(JSON.stringify(name2) + ' (false)', function () {
        assert.equal(caseDash.is(name2), false)
      })
    })
  })
})

@@ -449,91 +449,43 @@
     
-tests.forEach(function (pair) %7B%0A      var name = pair%5B0%5D,%0A        parsed = pair%5B1%5D%0A
+for (let %5Bname, parsed%5D of tests) %7B
 %0A   
@@ -621,33 +621,32 @@
 )%0A      %7D)%0A    %7D
-)
 %0A  %7D)%0A%0A  describ
@@ -685,91 +685,43 @@
     
-tests.forEach(function (pair) %7B%0A      var name = pair%5B0%5D,%0A        parsed = pair%5B1%5D%0A
+for (let %5Bname, parsed%5D of tests) %7B
 %0A   
@@ -861,25 +861,24 @@
     %7D)%0A    %7D
-)
 %0A  %7D)%0A%0A  des
@@ -914,100 +914,56 @@
     
-tests.forEach(function (pair) %7B%0A      var name1 = pair%5B0%5D,%0A        parsed = pair%5B1%5D,
+for (let %5Bname1, parsed%5D of tests) %7B
 %0A      
- 
+const
  nam
@@ -973,13 +973,12 @@
 = pa
-ir%5B1%5D
+rsed
 .joi
@@ -987,17 +987,20 @@
 '#')
-,
 %0A      
- 
+const
  val
@@ -1260,22 +1260,21 @@
      %7D)%0A
+
     %7D
-)
 %0A  %7D)%0A%7D)

Use ES6 in tests