Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Nov 25, 2024
1 parent cab1845 commit 39b18d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/commands/eval.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ function buildEvalCommand(yargs) {
query: {
type: "string",
description: "the query to run",
required: true,
},
dbname: {
type: "string",
Expand Down
5 changes: 4 additions & 1 deletion src/config/setup-test-container.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export function setupTestContainer() {
const container = setupCommonContainer();

const thingsToManuallyMock = automock(container);
const customfs = stub(fs);
// this is a mock used by the default profile behavior
customfs.readdirSync.withArgs(process.cwd()).returns([]);

const manualMocks = {
// process specifics
Expand All @@ -51,7 +54,7 @@ export function setupTestContainer() {
// wrap it in a spy so we can record calls, but use the
// real implementation
parseYargs: awilix.asValue(spy(parseYargs)),
fs: awilix.asValue(stub(fs)),
fs: awilix.asValue(customfs),
fsp: awilix.asValue({
unlink: stub(),
writeFile: stub(),
Expand Down
1 change: 1 addition & 0 deletions src/lib/command-helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const commonQueryOptions = {
secret: {
type: "string",
description: "the secret to use when calling Fauna",
required: true,
},
};

Expand Down

0 comments on commit 39b18d2

Please sign in to comment.