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

Commit 8ac94b4

Browse files
committed
fix lint
1 parent f908f02 commit 8ac94b4

File tree

3 files changed

+24
-35
lines changed

3 files changed

+24
-35
lines changed

package.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@
5555
"proseWrap": "always",
5656
"quote-props": "preserve"
5757
},
58-
"husky": {
59-
"hooks": {
60-
"pre-commit": "lint-staged"
61-
}
62-
},
63-
"lint-staged": {
64-
"*.{ts,tsx,js,jsx,css,json,md}": [
65-
"prettier --write",
66-
"git add"
67-
]
68-
},
6958
"dependencies": {
7059
"@azure/arm-containerregistry": "^7.0.0",
7160
"@azure/arm-resources": "^2.1.0",

src/commands/init.test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ describe("Test execute function", () => {
107107
describe("test getConfig function", () => {
108108
it("with configuration file", () => {
109109
const mockedValues = {
110-
azure_devops: {
111-
access_token: "access_token",
110+
"azure_devops": {
111+
"access_token": "access_token",
112112
org: "org",
113113
project: "project"
114114
}
@@ -125,8 +125,8 @@ describe("test getConfig function", () => {
125125
});
126126
const cfg = getConfig();
127127
expect(cfg).toStrictEqual({
128-
azure_devops: {
129-
access_token: "",
128+
"azure_devops": {
129+
"access_token": "",
130130
org: "",
131131
project: ""
132132
}
@@ -142,7 +142,7 @@ describe("test validatePersonalAccessToken function", () => {
142142
})
143143
);
144144
const result = await validatePersonalAccessToken({
145-
access_token: "token",
145+
"access_token": "token",
146146
org: "org",
147147
project: "project"
148148
});
@@ -154,7 +154,7 @@ describe("test validatePersonalAccessToken function", () => {
154154
.spyOn(axios, "get")
155155
.mockReturnValueOnce(Promise.reject(new Error("fake")));
156156
const result = await validatePersonalAccessToken({
157-
access_token: "token",
157+
"access_token": "token",
158158
org: "org",
159159
project: "project"
160160
});
@@ -167,8 +167,8 @@ const testHandleInteractiveModeFunc = async (
167167
verified: boolean
168168
): Promise<void> => {
169169
jest.spyOn(init, "getConfig").mockReturnValueOnce({
170-
azure_devops: {
171-
access_token: "",
170+
"azure_devops": {
171+
"access_token": "",
172172
org: "",
173173
project: ""
174174
},
@@ -181,9 +181,9 @@ const testHandleInteractiveModeFunc = async (
181181
}
182182
});
183183
jest.spyOn(init, "prompt").mockResolvedValueOnce({
184-
azdo_org_name: "org_name",
185-
azdo_pat: "pat",
186-
azdo_project_name: "project",
184+
"azdo_org_name": "org_name",
185+
"azdo_pat": "pat",
186+
"azdo_project_name": "project",
187187
toSetupIntrospectionConfig: true
188188
});
189189
jest
@@ -216,9 +216,9 @@ describe("test handleInteractiveMode function", () => {
216216
describe("test prompt function", () => {
217217
it("positive test", async done => {
218218
const answers = {
219-
azdo_org_name: "org",
220-
azdo_pat: "pat",
221-
azdo_project_name: "project",
219+
"azdo_org_name": "org",
220+
"azdo_pat": "pat",
221+
"azdo_project_name": "project",
222222
toSetupIntrospectionConfig: true
223223
};
224224
jest.spyOn(inquirer, "prompt").mockResolvedValueOnce(answers);
@@ -243,11 +243,11 @@ const testHandleIntrospectionInteractive = async (
243243
};
244244
}
245245
jest.spyOn(inquirer, "prompt").mockResolvedValueOnce({
246-
azdo_storage_account_name: "storagetest",
247-
azdo_storage_table_name: "storagetabletest",
248-
azdo_storage_partition_key: "test1234key",
249-
azdo_storage_repo_access_key: "repokey",
250-
azdo_storage_key_vault_name: withKeyVault ? "keyvault" : ""
246+
"azdo_storage_account_name": "storagetest",
247+
"azdo_storage_table_name": "storagetabletest",
248+
"azdo_storage_partition_key": "test1234key",
249+
"azdo_storage_repo_access_key": "repokey",
250+
"azdo_storage_key_vault_name": withKeyVault ? "keyvault" : ""
251251
});
252252
await handleIntrospectionInteractive(config);
253253
expect(config.introspection?.azure?.account_name).toBe("storagetest");

src/commands/init.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export const prompt = async (curConfig: ConfigYaml): Promise<Answer> => {
5555
];
5656
const answers = await inquirer.prompt(questions);
5757
return {
58-
azdo_org_name: answers.azdo_org_name as string,
59-
azdo_pat: answers.azdo_pat as string,
60-
azdo_project_name: answers.azdo_project_name as string,
58+
"azdo_org_name": answers.azdo_org_name as string,
59+
"azdo_pat": answers.azdo_pat as string,
60+
"azdo_project_name": answers.azdo_project_name as string,
6161
toSetupIntrospectionConfig: answers.toSetupIntrospectionConfig
6262
};
6363
};
@@ -73,8 +73,8 @@ export const getConfig = (): ConfigYaml => {
7373
} catch (_) {
7474
logger.info("current config is not found.");
7575
return {
76-
azure_devops: {
77-
access_token: "",
76+
"azure_devops": {
77+
"access_token": "",
7878
org: "",
7979
project: ""
8080
}

0 commit comments

Comments
 (0)