-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
[question] Is there a way to test generators written in typescript with yeoman-test? #105
Comments
And when I even try: import {Constructor, run} from "yeoman-test"
import {Generator} from "yeoman-generator"
import {MyGenerator} from "../generators/app"
const generator: Constructor<Generator> = MyGenerator.new
run(generator, {resolved: true}) I ended up with
|
Make sure your generator folder is called Otherwise you should register the namespace with the generator. |
Well, the directory name is ok. I finally found 2 issues:
import {describe, beforeEach} from "mocha"
import {join} from "path"
import {copySync} from "fs-extra"
import {file} from "yeoman-assert"
import {Constructor, run} from "yeoman-test"
// import {Generator} from "yeoman-generator"
import {MyGenerator} from "../generators/app"
describe('JHipster generator aanno', () => {
// const generator: Constructor<Generator> = MyGenerator.new
describe('Test with Maven and AngularX', () => {
beforeEach(done => {
// run(join(__dirname, '../generators/app'))
run(MyGenerator as any)
... The |
Looks like the problem is with yeoman-test type definition. |
Is there a way to test generators written in typescript with yeoman-test?
When I try something like
I've got an error:
Hence it is perhaps better to pass the constructor there. But I don't know to do that, i.e. the following is wrong:
The text was updated successfully, but these errors were encountered: