premasagar / pablo

Pablo is a lightweight, expressive JavaScript SVG library. Pablo creates interactive drawings with SVG (Scalable Vector Graphics), giving access to all of SVG's granularity and power.
https://pablojs.com
MIT License
413 stars 16 forks source link

tests: add tests for remaining methods #47

Closed premasagar closed 11 years ago

premasagar commented 11 years ago

e.g. every, select, reverse

premasagar commented 11 years ago

A list of all methods (run in the console):

function logMethods(obj){
    for (prop in obj){
        if (typeof obj[prop] === 'function'){
            console.log(prop);
        }
    }
}

console.log('\n\n\n*** PABLO COLLECTION API ***');
logMethods(Pablo.fn);

console.log('\n\n\n*** STATIC METHODS ***');
logMethods(Pablo);
AaronAcerboni commented 11 years ago

var prop; for (prop in Pablo.Collection){ if (typeof Pablo.Collection(prop) === 'function'){ console.log(prop); } }

This code isn't working unfortunately

premasagar commented 11 years ago

Code snippet updated...

AaronAcerboni commented 11 years ago

There are no tests for the following:

*** PABLO COLLECTION API ***
traverse
getValue
premasagar commented 11 years ago

All are worth testing, except forEach, which is an alias of each.

relations has been renamed to traverse (pull).

To test Pablo.Collection:

Pablo.Collection.prototype === Pablo.fn; // true
Pablo.g() instanceof Pablo.Collection; // true