The given paper considers a problem of generating words of a context-dependent language. It reviews the application of the problem to the unit testing of functions, examines in detail the use of generators in property-based testing. The context-dependent language of λ-calculus with a simple type system Λ→ is considered, and the problem is refined up to generating λ-terms with the given type within the given context. The article proposes a generation method that was implemented using the combinators of the fast-check library, which provides property-based testing in JavaScript.