goatslacker / get-parameter-names

Retrieves the argument names of a function
46 stars 13 forks source link

Changed test library to mocha and refactored the implementation #2

Closed frerom closed 10 years ago

frerom commented 10 years ago

When the testla library was added as a dependency there was a circular dependency issue. Testla uses get-parameter-names. I changed the testing library to mocha and wrote new tests and also refactored the code so it is hopefully easier to follow. The only new behaviour of this snippet is that get-parameter-names throws an exception if a function isn't provided.

goatslacker commented 10 years ago

Makes sense to move away from testla. I dislike Mocha but I'm not opposed to switching to it.

Your implementation won't work for:

function flip(
  a,
  b
) {
  return b;
}

Also, can you please port over the current tests to mocha as well?

frerom commented 10 years ago

All valid points. I will fix this today!

frerom commented 10 years ago

I ported the tests to mocha and merge with your knew implementation. Also added a couple of semi-colons to the new implementation.

goatslacker commented 10 years ago

Thanks for the pull request

frerom commented 10 years ago

no problem!