jackbsteinberg / get-originals-rewriter

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Test: transforming function arguments annotated with JSDoc comments #31

Open domenic opened 5 years ago

domenic commented 5 years ago

We need to expand or create counterparts to all the existing test cases to test cases where the type is only known through JSDoc comments. For example

const doc = document;
foo(doc);

/**
 * Does things
 *
 * @param {Document} document - a document
 */
function foo(d) {
  d.createElement();
}

needs to rewrite the createElement() call.

These tests need to cover all possible combinations of { namespace function, static method, method, getter, setter, constructor } x { JS, web } x { directly on object, on prototype }.