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

Test scaffolding out in alternative to the os temp folder #61

Closed
danpetitt opened this issue Dec 15, 2019 · 3 comments
Closed

Test scaffolding out in alternative to the os temp folder #61

danpetitt opened this issue Dec 15, 2019 · 3 comments

Comments

@danpetitt
Copy link

I am having problems running the tests in our CI environment because the OS tmp folder is locked down; so after reading around I discovered the helper.inDir method.

However, setting the parameter to a custom folder which I can then exclude from distribution doesnt do anything ... the tmp folder which the tests create, now sits in the main project folder and not the os.tmp folder, however, but its not what i was expecting

Any idea what I am doing wrong here?

const tempFolderPath = `${path.join(__dirname, '../test_tmp/')}/${uuidv4()}/`;

helpers
    .run(path.join(__dirname, '../generators/app'))
    .inDir(tempFolderPath)
    .withOptions({ skipInstall: true })
    .withPrompts(defaultAnswers)
    .on('end', done);

I have also tried creating the temp folder myself and then cd ing into it, but again it just creates the test generator structure in the project folder.

const tempFolderPath = `${path.join(__dirname, '../test_tmp/')}/${uuidv4()}/`;

helpers
    .run(path.join(__dirname, '../generators/app'))
    .inDir(tempFolderPath)
    .withOptions({ skipInstall: true })
    .withPrompts(defaultAnswers)
    .cd(tempFolderPath)
    .on('end', done);

Apologies in advance if this isnt a bug, and just my usage.

@SBoudrias
Copy link
Member

Any chance the place the project is generate changes because there's a .yo-rc.json file in a parent folder?

@danpetitt
Copy link
Author

I do have a file in project folder but it is currently empty; should I remove it?

@danpetitt
Copy link
Author

Removing the rc file worked; cool thanks @SBoudrias

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