Skip to content

Commit

Permalink
test(testenv): Update test/helpers/init.js
Browse files Browse the repository at this point in the history
Add environment variables that are set during test initialization to
ensure portability between local and CI Build environments

Related to: #133
  • Loading branch information
VivekMChawla committed Mar 7, 2019
1 parent c4d1791 commit eb715b2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions test/helpers/init.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
const path = require('path')
process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json')
const path = require('path');
const del = require('del');

// Set environment vars in the current process.
process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json'); // Part of the boilerplate code.
process.env.FALCON_COMMAND_RUNNER = path.resolve('bin/run'); // Path to the command runner utility.
process.env.FALCON_TEST_TEMPDIR = path.resolve('test/temp'); // Path to the temp directory used during tests.

// Delete everything inside of the Falcon Test Temp Directory EXCEPT .gitignore
del.sync(
[
`${process.env.FALCON_TEST_TEMPDIR}/**/*`, // Delete everything from the Test Temp Directory
`!${process.env.FALCON_TEST_TEMPDIR}/.gitignore` // EXCEPT the .gitignore file.
],
{
dryRun: false, // Determines if the command will actually delete or just return an array of what WOULD be deleted.
dot: true // Determines if dotfiles are deleted or not.
}
);

0 comments on commit eb715b2

Please sign in to comment.