-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): ensure 'noProject' commands run in invalid projects
- Loading branch information
Showing
4 changed files
with
70 additions
and
26 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2018 Garden Technologies, Inc. <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import { expect } from "chai" | ||
import { makeDummyGarden } from "../../../../src/cli/cli" | ||
import { getDataDir } from "../../../helpers" | ||
|
||
describe("cli", () => { | ||
describe("makeDummyGarden", () => { | ||
it("should initialise and resolve config graph in a directory with no project", async () => { | ||
const garden = await makeDummyGarden("./foobarbas", {}) | ||
const dg = await garden.getConfigGraph(garden.log) | ||
expect(garden).to.be.ok | ||
expect(await dg.getModules()).to.not.throw | ||
}) | ||
it("should initialise and resolve config graph in a project with invalid config", async () => { | ||
const root = getDataDir("test-project-invalid-config") | ||
const garden = await makeDummyGarden(root, {}) | ||
const dg = await garden.getConfigGraph(garden.log) | ||
expect(garden).to.be.ok | ||
expect(await dg.getModules()).to.not.throw | ||
}) | ||
it("should initialise and resolve config graph in a project with template strings", async () => { | ||
const root = getDataDir("test-project-templated") | ||
const garden = await makeDummyGarden(root, {}) | ||
const dg = await garden.getConfigGraph(garden.log) | ||
expect(garden).to.be.ok | ||
expect(await dg.getModules()).to.not.throw | ||
}) | ||
}) | ||
}) |
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