Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilde345 committed Dec 12, 2024
1 parent f8ae8ad commit d9939ca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/lib/config/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ export function configParser(argvInput, path) {

const profile = argv.profile || process.env.FAUNA_PROFILE;

// console.log(
// "in config",
// argvInput,
// userProvidedConfigPath,
// profile,
// parsedPath,
// );

if (!parsedPath) {
// if there no config file, we need to assert that no profile is specified

Expand Down
22 changes: 22 additions & 0 deletions test/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,28 @@ describe("configuration file", function () {
expect(stripAnsi(stderr.getWritten())).to.equal(message);
});

it("ignores default config file if neither profile nor config are specified", async function () {
const defaultConfig = `
{
"default": {
"color": false,
"json": true,
"quiet": true,
},
}
`.trim();
await runArgvTest({
cmd: `argv`,
pathMatcher: path.join(__dirname, "../fauna.config.yaml"),
argvMatcher: sinon.match({
color: true,
json: false,
quiet: false,
}),
configToReturn: defaultConfig,
});
});

it.skip("preserves comments in the config file", async function () {});
});

Expand Down

0 comments on commit d9939ca

Please sign in to comment.