Skip to content
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

Overwriting prompts #26

Open
tiagoporto opened this issue Oct 24, 2017 · 2 comments
Open

Overwriting prompts #26

tiagoporto opened this issue Oct 24, 2017 · 2 comments

Comments

@tiagoporto
Copy link

My test files is

describe('Package.json File', function () {
  before(function () {
    return yoTest
      .run(path.join(__dirname, '../../app'))
      .withPrompts({
        integrations: ['coveralls']
      })
      .toPromise()
  })

  it('With coveralls', function () {
    assert.equalsFileContent('package.json', fs.readFileSync(path.resolve(__dirname, 'coveralls.json'), 'utf-8'))
  })
})

describe('Package.json File', function () {
  before(function () {
    return yoTest
      .run(path.join(__dirname, '../../app'))
      .withPrompts({
        integrations: ['travis']
      })
      .toPromise()
  })

  it('With travis', function () {
    assert.equalsFileContent('package.json', fs.readFileSync(path.resolve(__dirname, 'travis.json'), 'utf-8'))
  })
})

On the first test With coveralls run with parameter integrations: ['coveralls'], on the second I change the parameter integrations: ['travis']. The problem is, on the second test the first parameter still there.

Im doing something wrong?

@SBoudrias
Copy link
Member

Nothing stands out from your example. Any chance that's a code bug on your side? This is a pretty common use case and is working fine on my generators.

@tiagoporto
Copy link
Author

I've debug the code and the parameters are right. When I run yo manually the result is expected. But when I run the tests seems that the result are concatenated on the return of the before. There is a way to clean the variable var yoTest = require('yeoman-test') before execute another run()?

Now I don't know if the bug is on yeoman-assert or yeoman-test.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants