Skip to content

Commit

Permalink
fix: cleanup tilde-path-app post test
Browse files Browse the repository at this point in the history
ensure test app is remove afterward

follows: loopbackio#4652
Signed-off-by: Douglas McConnachie <[email protected]>
  • Loading branch information
dougal83 committed Feb 17, 2020
1 parent 82f773e commit e6362f2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/cli/test/integration/generators/app.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ describe('app-generator with tilde project path', () => {
const cwd = process.cwd();

// If the test runs outside $home directory
if (process.env.CI && !process.env.DEBUG && tildify(sandbox) === sandbox) {
const runsOutsideRoot =
process.env.CI && !process.env.DEBUG && tildify(sandbox) === sandbox
? true
: false;
if (runsOutsideRoot) {
sandbox = path.join(os.homedir(), '.lb4sandbox/tilde-path-app');
pathWithTilde = '~/.lb4sandbox/tilde-path-app';
}
Expand Down Expand Up @@ -295,7 +299,12 @@ describe('app-generator with tilde project path', () => {
// eslint-disable-next-line no-invalid-this
this.timeout(30 * 1000);

process.chdir(sandbox);
// Handle special case - Skipping... not inside the project root directory.
if (runsOutsideRoot) {
process.chdir(sandbox);
} else {
process.chdir(rootDir);
}
build.clean(['node', 'run-clean', sandbox]);
process.chdir(cwd);
});
Expand Down

0 comments on commit e6362f2

Please sign in to comment.