zowe / zowe/zowe-cli-sample-plugin

Tests fails when mocking fs.readFileSync

Open
#55 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority-low severity-low
Dominant language
TypeScript
Stars
10
Forks
15
Avg merge
2d 6h
Merged PRs (30d)
6

Description

The test failure has been address in the CLI repo by properly mocking fs.readFileSync but allowing yargs to use the real implementation.
See https://github.com/zowe/zowe-cli/blob/master/__mocks__/fs.ts#L52-L55

Originally posted by @zFernand0 in https://github.com/zowe/zowe-cli-sample-plugin/pull/53#issuecomment-713636640

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the plugin's test mocking setup with mocks/fs.ts lines 52-55 in the referenced zowe-cli repository, focusing on how yargs uses the real implementation. Run the failing tests and consider the issue done when the fs.readFileSync mock works without breaking yargs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.