Skip to content

Commit

Permalink
test: Add getWorkDirName()
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Feb 21, 2020
1 parent da016e1 commit 20653ab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ beforeEach(() => {

// });

describe('getWorkDirName()', () => {
test('get work directory name', async () => {
const date = new Date();
const unixTime = date.getTime();

let home = '';
if (process.platform === 'win32') {
home = 'C:\\Users\\runneradmin';
} else {
home = `${process.env.HOME}`;
}
const expected = path.join(home ,`actions_github_pages_${unixTime}`);
const test = await getWorkDirName(`${unixTime}`);
expect(test).toMatch(expected);
});
});

describe('getHomeDir()', () => {
test('get home directory name', async () => {
let test = '';
Expand Down

0 comments on commit 20653ab

Please sign in to comment.