This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from teamdigitale/fix-cci-build
Fix build on circle CI
- Loading branch information
Showing
11 changed files
with
102 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import {Command, flags} from '@oclif/command' | ||
import { Command, flags } from "@oclif/command"; | ||
|
||
export default class Hello extends Command { | ||
static description = 'describe the command here' | ||
public static description = "describe the command here"; | ||
|
||
static examples = [ | ||
// tslint:disable-next-line: readonly-array | ||
public static examples = [ | ||
`$ io-ops hello | ||
hello world from ./src/hello.ts! | ||
`, | ||
] | ||
` | ||
]; | ||
|
||
static flags = { | ||
help: flags.help({char: 'h'}), | ||
public static flags = { | ||
help: flags.help({ char: "h" }), | ||
// flag with a value (-n, --name=VALUE) | ||
name: flags.string({char: 'n', description: 'name to print'}), | ||
name: flags.string({ char: "n", description: "name to print" }), | ||
// flag with no value (-f, --force) | ||
force: flags.boolean({char: 'f'}), | ||
} | ||
|
||
static args = [{name: 'file'}] | ||
force: flags.boolean({ char: "f" }) | ||
}; | ||
|
||
async run() { | ||
const {args, flags} = this.parse(Hello) | ||
public async run(): Promise<void> { | ||
const { args, flags: parsedFlags } = this.parse(Hello); | ||
|
||
const name = flags.name || 'world' | ||
this.log(`hello ${name} from ./src/commands/hello.ts`) | ||
if (args.file && flags.force) { | ||
this.log(`you input --force and --file: ${args.file}`) | ||
const name = parsedFlags.name || "world"; | ||
this.log(`hello ${name} from ./src/commands/hello.ts`); | ||
if (args.file && parsedFlags.force) { | ||
this.log(`you input --force and --file: ${args.file}`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export {run} from '@oclif/command' | ||
export { run } from "@oclif/command"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import {expect, test} from '@oclif/test' | ||
import { expect, test } from "@oclif/test"; | ||
|
||
describe('hello', () => { | ||
describe("hello", () => { | ||
test | ||
.stdout() | ||
.command(['hello']) | ||
.it('runs hello', ctx => { | ||
expect(ctx.stdout).to.contain('hello world') | ||
}) | ||
.command(["hello"]) | ||
.it("runs hello world", ctx => { | ||
expect(ctx.stdout).to.contain("hello world"); | ||
}); | ||
|
||
test | ||
.stdout() | ||
.command(['hello', '--name', 'jeff']) | ||
.it('runs hello --name jeff', ctx => { | ||
expect(ctx.stdout).to.contain('hello jeff') | ||
}) | ||
}) | ||
.command(["hello", "--name", "jeff"]) | ||
.it("runs hello --name jeff", ctx => { | ||
expect(ctx.stdout).to.contain("hello jeff"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import {expect, test} from '@oclif/test' | ||
import { expect, test } from "@oclif/test"; | ||
import { hasCosmosConnection } from "../../../src/utils/azure"; | ||
|
||
describe('users:list', () => { | ||
test | ||
.stdout() | ||
.command(['users:list']) | ||
.it('runs hello', ctx => { | ||
expect(ctx.stdout).to.contain('hello world') | ||
}) | ||
describe("list all profiles", () => { | ||
/** | ||
* if host has the az client installed and valid cosmos credentials we test command first output line matches | ||
* the header row (fiscalCode column name). Otherwise the test will be skipped | ||
*/ | ||
|
||
before(async function(): Promise<void> { | ||
const isCosmosConnectionAvailable = await hasCosmosConnection( | ||
"agid-rg-test", | ||
"agid-cosmosdb-test" | ||
); | ||
// az cli not installed or bad cosmos credential, test no needed | ||
if (!isCosmosConnectionAvailable) { | ||
// tslint:disable-next-line: no-invalid-this | ||
this.skip(); | ||
} | ||
}); | ||
test | ||
.stdout() | ||
.command(['users:list', '--name', 'jeff']) | ||
.it('runs hello --name jeff', ctx => { | ||
expect(ctx.stdout).to.contain('hello jeff') | ||
}) | ||
}) | ||
.command(["profiles:list"]) | ||
.it("runs profiles command to list all users", ctx => { | ||
expect(ctx.stdout).match(/^fiscalCode/); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
--watch-extensions ts | ||
--recursive | ||
--reporter spec | ||
--timeout 5000 | ||
--timeout 15000 |