yamadapc/jsdoctest

Semicolon insertion breaks complex examples

ianwremmel opened this issue · 4 comments

I'm trying to write a test that does an async action and makes some assertions about a non-deterministic result

createResource()
  .then(function(resource) {
    assert(typeof resource.id !== 'undefined')
    return 'success';
  });
  // async => 'success'

This fails because jsdoctest seems to add a semicolon to the end of each line and therefore produces invalid javascript.

Mm... Could you send the full block that you're using?

I'll fix it this week. For now if you move .then to the createResource line you should be fine.

EDIT Perhaps using a more principled approach would be better.

Pushed preliminary fix, going to try a more principled approach to getting this to properly work.

awesome, thanks for the quick response!