From 6a153b8ec0b6fdfed2161b4908540a23888b6158 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Wed, 5 Sep 2018 18:50:00 -0700 Subject: [PATCH] chore: test `garden scan` for each example project --- garden-cli/test/src/commands/scan.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/garden-cli/test/src/commands/scan.ts b/garden-cli/test/src/commands/scan.ts index 897b026828..bdf05cc9cc 100644 --- a/garden-cli/test/src/commands/scan.ts +++ b/garden-cli/test/src/commands/scan.ts @@ -1,14 +1,15 @@ -import { join } from "path" import { Garden } from "../../../src/garden" import { ScanCommand } from "../../../src/commands/scan" +import { getExampleProjects } from "../../helpers" describe("ScanCommand", () => { - it("should successfully scan the hello-world project", async () => { - const root = join(__dirname, "..", "..", "..", "..", "examples", "hello-world") - const garden = await Garden.factory(root) - const ctx = garden.getPluginContext() - const command = new ScanCommand() + for (const [name, path] of Object.entries(getExampleProjects())) { + it(`should successfully scan the ${name} project`, async () => { + const garden = await Garden.factory(path) + const ctx = garden.getPluginContext() + const command = new ScanCommand() - await command.action({ garden, ctx, args: {}, opts: {} }) - }) + await command.action({ garden, ctx, args: {}, opts: {} }) + }) + } })