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 · 4 comments · Fixed by #360
Closed

unable to test when employing template strings #358

jmonster opened this issue May 15, 2015 · 4 comments · Fixed by #360
Assignees
Labels
bug Bug or defect
Milestone

Comments

@jmonster
Copy link
Contributor

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 Bug or defect 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 as completed in #360 May 19, 2015
@jmonster
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor

Marsup commented May 20, 2015

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

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants