Closed nzacca closed 6 years ago
Fixed this issue. Sorry for the erroneous report.
In case anyone else was having this same issue, here's what I did to resolve:
files
property:
files
property:
import { get, def } from "bdd-lazy-var/getter"
in my spec files.
I inadvertently added the getter definitions to the include
instead of the files
previously which led to the error reported.
Hello!
Great library! We ran into the above error recently and we're not sure why or what the cause might be.
This occurs on v2.2.3 on line https://github.com/stalniy/bdd-lazy-var/blob/master/getter.js#L126
It appears that the
context
is undefined when it is passed from here: https://github.com/stalniy/bdd-lazy-var/blob/master/getter.js#L534The issue appears to be that if the
this.state.contexts
is empty,this.currentContext
is returning undefined which leads to the above error. https://github.com/stalniy/bdd-lazy-var/blob/master/getter.js#L545Hopefully this is an easy fix.
Cheers!
Update: Just noticed that this appears to occur when we have a suite that does not use any
def
definitions. If we set the test focus to only the suites withdef
variables defined then everything works as expected.