We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Say I wrote my custom generator like this
class extends Generator { writing() { this._private_method(); } _private_method() { console.log('private hey'); } }
with use of private methods according to doc recommendation
I'd like to unit test only _private_method()
_private_method()
I tried to setup test like:
const Generator = require('../generators/app'); const generator = new Generator(); describe('generator:_private_method', () => { it('returns correct output', () => { assert(generator._private_method()); }); });
but I get error TypeError: Cannot use 'in' operator to search for 'help' in undefined
TypeError: Cannot use 'in' operator to search for 'help' in undefined
The text was updated successfully, but these errors were encountered:
The Generator class expect arguments to be passed in. It requires an instance of yeoman-environment to work properly.
yeoman-environment
Something like const generator = environment.createEnv().instantiate(Generator).
const generator = environment.createEnv().instantiate(Generator)
This isn't really a public interface, so you might need to dig through the environment code to get it to work properly.
Sorry, something went wrong.
Thank you @SBoudrias 🙏
No branches or pull requests
Say I wrote my custom generator like this
with use of private methods according to doc recommendation
I'd like to unit test only
_private_method()
I tried to setup test like:
but I get error
TypeError: Cannot use 'in' operator to search for 'help' in undefined
The text was updated successfully, but these errors were encountered: