Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to test when employing template strings #358

Closed
jmonster opened this issue May 15, 2015 · 3 comments · Fixed by #360
Assignees
Labels
bug
Milestone

Comments

@jmonster
Copy link
Contributor

@jmonster jmonster commented May 15, 2015

I'm enjoying some ES6 fanciness, e.g:

callback(null, `https://${host}${path}`, headers);

However, Lab can't process this:

> node ./node_modules/.bin/lab --timeout 5000 --lint --coverage

/Users/johnny/Documents/lanai/node_modules/lab/node_modules/espree/espree.js:5435
        throw e;
              ^
Error: Line 12: Unexpected token ILLEGAL

So I've altered my package.json to pass in the necessary --use_strict argument that is needed to unlock this feature:

"scripts": {
    "test": "node --use_strict ./node_modules/.bin/lab --timeout 5000 --lint --coverage",
    "start": "node --use_strict index.js"
  }

But once I do this, I encounter a new problem:

> node --use_strict ./node_modules/.bin/lab --timeout 5000 --lint --coverage

/Users/johnny/Documents/lanai/node_modules/lab/lib/coverage.js:248
        __$$labCov = {
                   ^
ReferenceError: __$$labCov is not defined

Of course if I drop --coverage, everything runs to completion just fine.. thoughts?

Marsup added a commit to Marsup/lab that referenced this issue May 16, 2015
@geek geek added the bug label May 19, 2015
@geek geek added this to the 5.9.0 milestone May 19, 2015
@geek geek self-assigned this May 19, 2015
@geek geek closed this in #360 May 19, 2015
@jmonster

This comment has been minimized.

Copy link
Contributor Author

@jmonster jmonster commented May 20, 2015

Hey @geek thanks for taking a look at this, but I'm still having the issue -- although without any mention of __$$labCov:

uku ➤ npm test                                                                                                                                                  git:master*

> uku@0.0.1 test /Users/jdomino/Documents/heroku/uku
> lab --timeout 5000 --lint --coverage

/Users/jdomino/Documents/heroku/uku/node_modules/lab/node_modules/espree/espree.js:5435
        throw e;
              ^
Error: Line 12: Unexpected token ILLEGAL

If I simply remove all usage of template strings in my code [by commenting them out], this command runs to completion just fine.

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented May 20, 2015

@jmonster I think we will want to change our options when we call espree to be tolerant of parser errors. I will log an issue

@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented May 20, 2015

@geek This is probably more a matter of enabling espree ES6 feature here.

@jmonster jmonster mentioned this issue Jun 25, 2015
7 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.