stalniy / bdd-lazy-var

Provides UI for testing frameworks such as mocha, jasmine and jest which allows to define lazy variables and subjects.
MIT License
162 stars 14 forks source link

Is it expected that calling get for a value which is not defined throws an error ? #31

Closed iain-b closed 6 years ago

iain-b commented 6 years ago

More of a question but I'm getting an error trying calling get for a value which is undefined (has no corresponding def rather than is set to undefined). Is this expected ? If so could there be a better error message like The value 'foo' was not defined or similar.

Currently, I'm getting an error as follows, it doesn't really give me much to go on:


TypeError: Cannot read property 'evaluate' of undefined
    at Metadata.getVar (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:206:45)
    at Variable.value (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:304:42)
    at Function.evaluate (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:275:25)
    at get$$1 (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:356:23)
    at assets/unit.js:56381:18
    at VariableMetadata.evaluate (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:159:44)
    at Metadata.getVar (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:206:45)
    at Variable.value (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:304:42)
    at Function.evaluate (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:275:25)
    at get$$1 (eval at Array.concat.module.exports (assets/unit.js:23649:9), <anonymous>:356:23)```
stalniy commented 6 years ago

Hi thank you for the issues!

I will try to check it soon