Skip to content

Commit

Permalink
disable executing of commands during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thboop committed Sep 29, 2020
1 parent 5590df7 commit d36cf58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion __tests__/authutil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ describe('authutil tests', () => {
.toString(36)
.substring(7)
);
process.env['GITHUB_ENV'] = ''; // Stub out ENV file functionality so we can verify it writes to standard out
console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions
process.env['GITHUB_ENV'] = ''; // Stub out Environment file functionality so we can verify it writes to standard out (toolkit is backwards compatible)
const tempDir = path.join(_runnerDir, randPath, 'temp');
await io.rmRF(tempDir);
await io.mkdirP(tempDir);
Expand Down Expand Up @@ -62,6 +63,7 @@ describe('authutil tests', () => {
if (_runnerDir) {
await io.rmRF(_runnerDir);
}
console.log('::stoptoken::'); // Re-enable executing of runner commands when running tests in actions
}, 100000);

function readRcFile(rcFile: string) {
Expand Down
5 changes: 4 additions & 1 deletion __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('setup-node', () => {

beforeEach(() => {
// @actions/core
console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions
process.env['GITHUB_PATH'] = ''; // Stub out ENV file functionality so we can verify it writes to standard out
inputs = {};
inSpy = jest.spyOn(core, 'getInput');
Expand Down Expand Up @@ -103,7 +104,9 @@ describe('setup-node', () => {
//jest.restoreAllMocks();
});

afterAll(async () => {}, 100000);
afterAll(async () => {
console.log('::stoptoken::'); // Re-enable executing of runner commands when running tests in actions
}, 100000);

//--------------------------------------------------
// Manifest find tests
Expand Down

0 comments on commit d36cf58

Please sign in to comment.