Skip to content

Write unit tests for libraries #2

BYK opened this Issue Aug 19, 2011 · 2 comments

2 participants

BYK commented Aug 19, 2011

All libraries should have unit tests to ensure a bug-free library set.

@burcu said:

I'm not sure about licensing but V8 has the full functional JS tests under, tests related to ES5 features can be extracted from their repo. Licensing should be researched though.

on Google Code project before.

@berkerpeksag berkerpeksag was assigned Aug 19, 2011
@berkerpeksag berkerpeksag reopened this Nov 28, 2011
  • should be tested too.
  • test/unit/Object.js: keys() -> This test does not cover any of the edge cases like "hasOwnProperty" and a possible override of "hasOwnProperty" which our code suffers from =)
  • We should test getPrototypeOf too, somehow.
  • test/unit/Array.js: map() -> May be we should consider using ".join(',')" for a more explicit concatenation. Also I think we should explicitly check if the returned array is not the same array as the array the method called on since this is important.
  • test/unit/Array.js: every() -> 'Testing size of all array elements.' explanation is used almost for every test and it does not explain the test case very good. We should change that.
  • test/unit/Array.js: indexOf() -> May be we should check for an element in the middle or in the end. Also we don't check the "fromIndex" parameter and its effect on the result.
  • test/unit/Array.js: isArray() -> // All following calls should return true ;)
@BYK BYK added a commit that referenced this issue Dec 11, 2011
@BYK Fixed Object.keys to recover if the object iself has a key named 'has…
…OwnProperty' and modified the unit test to test this behavior. Added test for Object.getPrototypeOf. (progresses #2)
@BYK BYK added a commit that closed this issue Dec 11, 2011
@BYK Closes #2 9420c9d
@BYK BYK closed this in 9420c9d Dec 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.