Skip to content

Commit

Permalink
minor cleanup in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Dec 13, 2023
1 parent acba73b commit 6212ccd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cmd/logic-function.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ describe('LogicFunctionCommands', () => {
it('returns if paths do not exist', async () => {
sinon.stub(fs, 'pathExists').resolves(false);

const paths = ['dir/', 'dir/path/to/file'];

const res = await logicFunctionCommands._validatePaths({ jsonPath: paths[1], _exit: sinon.stub() });
const res = await logicFunctionCommands._validatePaths({ jsonPath: 'dir/path/to/file', _exit: sinon.stub() });

expect(res).to.eql(false);

Expand All @@ -348,9 +346,8 @@ describe('LogicFunctionCommands', () => {
const exitStub = sinon.stub();
sinon.stub(fs, 'pathExists').resolves(true);
sinon.stub(logicFunctionCommands, '_promptOverwrite').resolves(false);
const paths = ['dir/', 'dir/path/to/file'];

await logicFunctionCommands._validatePaths({ jsonPath: paths[1], _exit: exitStub });
await logicFunctionCommands._validatePaths({ jsonPath: 'dir/path/to/file', _exit: exitStub });

expect(logicFunctionCommands._promptOverwrite.callCount).to.eql(1);
expect(exitStub.callCount).to.eql(1);
Expand Down

0 comments on commit 6212ccd

Please sign in to comment.