Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add project_findreplace cases #146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

shuang6
Copy link
Contributor

@shuang6 shuang6 commented May 12, 2021

Objective

Add find/replace in project unit test cases

Abstractions

Src/project/findReplace folder contains the following tests:
Find in project
Open search result
Clear search result
Apply replacement in project
Replace in project
Find in file

Tests performed

Passed Local and Github tests

Screen shot

eee

@shuang6 shuang6 requested a review from Sen-real May 12, 2021 07:05
@@ -22,7 +22,7 @@ export async function findInProject() {
if (ProjectTreeProvider.hasProjectOpened() == false) {
let msg = localize("autolispext.project.find.openproject", "A project must be open before you can search for a text string.");
vscode.window.showInformationMessage(msg);
return;
return Promise.reject(msg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen in a real, manual use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not happen on manual case. So later, I will delete the test cases.

Comment on lines 47 to 53
closeParenStyleStub = ImportMock.mockFunction(os, 'arch', 'x64');
closeParenStyleStub = ImportMock.mockFunction(opt, 'getSearchOption', searchobj);
closeParenStyleStub = ImportMock.mockFunction(vscode.commands, 'executeCommand', mock_value);
closeParenStyleStub = ImportMock.mockFunction(opt, 'getString', "remove -layer");
closeParenStyleStub = ImportMock.mockFunction(os, 'type', 'Darwin');
closeParenStyleStub = ImportMock.mockFunction(fs, 'accessSync', null);
closeParenStyleStub = ImportMock.mockFunction(fs, 'chmodSync', null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please give each stub an identical name, and restore them all in suiteTeardown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@github-actions
Copy link

github-actions bot commented Aug 29, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@adstchens
Copy link
Contributor

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants