Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 397567b

Browse files
dennisseahmtarng
andauthored
[HOUSEKEEPING] use common function and remove unused imports and vars (#301)
Co-authored-by: Michael Tarng <20913254+mtarng@users.noreply.github.com>
1 parent f087fd8 commit 397567b

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

src/commands/deployment/validate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
IDeploymentTable,
88
updateACRToHLDPipeline
99
} from "../../lib/azure/deploymenttable";
10-
import { validateStorageAccount } from "../../lib/azure/storage";
1110
import { build as buildCmd, exit as exitCmd } from "../../lib/commandBuilder";
1211
import { logger } from "../../logger";
1312
import { IConfigYaml } from "../../types";

src/commands/hld/init.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
RENDER_HLD_PIPELINE_FILENAME
88
} from "../../lib/constants";
99
import { checkoutCommitPushCreatePRLink } from "../../lib/gitutils";
10+
import { createTempDir } from "../../lib/ioUtil";
1011
import {
1112
disableVerboseLogging,
1213
enableVerboseLogging,
@@ -79,8 +80,7 @@ const testRepoInitialization = async (
7980
componentPath: string
8081
) => {
8182
// Create random directory to initialize
82-
const randomTmpDir = path.join(os.tmpdir(), uuid());
83-
fs.mkdirSync(randomTmpDir);
83+
const randomTmpDir = createTempDir();
8484

8585
logger.info(`creating randomTmpDir ${randomTmpDir}`);
8686

src/commands/project/pipeline.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { create as createBedrockYaml } from "../../lib/bedrockYaml";
22
import { createTempDir } from "../../lib/ioUtil";
3-
import {
4-
disableVerboseLogging,
5-
enableVerboseLogging,
6-
logger
7-
} from "../../logger";
3+
import { disableVerboseLogging, enableVerboseLogging } from "../../logger";
84
jest.mock("../../lib/pipelines/pipelines");
95

106
import {

src/config.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { createTempDir } from "./lib/ioUtil";
1515
import { disableVerboseLogging, enableVerboseLogging } from "./logger";
1616
import { IBedrockFile } from "./types";
1717

18-
const variableGroupName = uuid();
19-
2018
beforeAll(() => {
2119
enableVerboseLogging();
2220
});

src/lib/gitutils.with-exec.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import fs from "fs";
2-
import os from "os";
3-
import path from "path";
4-
import uuid from "uuid/v4";
51
import { disableVerboseLogging, enableVerboseLogging } from "../logger";
62
import { getCurrentBranch } from "./gitutils";
3+
import { createTempDir } from "./ioUtil";
74
import { exec } from "./shell";
85

96
beforeAll(() => {
@@ -16,8 +13,7 @@ afterAll(() => {
1613

1714
describe("getCurrentBranch", () => {
1815
it("should return 'master' when working on a newly created repo with 0 commits", async () => {
19-
const randomTmpDir = path.join(os.tmpdir(), uuid());
20-
fs.mkdirSync(randomTmpDir);
16+
const randomTmpDir = createTempDir();
2117

2218
// initialize the new git repo
2319
await exec("git", ["init"], { cwd: randomTmpDir });
@@ -27,8 +23,7 @@ describe("getCurrentBranch", () => {
2723
});
2824

2925
it("should return 'foobar' when working on a newly created repo with 0 commits and 'foobar' has been checked out", async () => {
30-
const randomTmpDir = path.join(os.tmpdir(), uuid());
31-
fs.mkdirSync(randomTmpDir);
26+
const randomTmpDir = createTempDir();
3227

3328
// initialize the new git repo and checkout 'foobar'
3429
await exec("git", ["init"], { cwd: randomTmpDir });

0 commit comments

Comments
 (0)