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 test case for rename file #1574

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Conversation

jdneo
Copy link
Collaborator

@jdneo jdneo commented Aug 12, 2020

This is to prevent the regression in the future, for the issue: #1517

Signed-off-by: Sheng Chen sheche@microsoft.com

test('rename on file will update the class name', async function () {
const workspaceEdit: WorkspaceEdit = new WorkspaceEdit();
workspaceEdit.renameFile(Uri.file(originFilePath), Uri.file(newFilePath));
await workspace.applyEdit(workspaceEdit);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The unit test will modify the test project file in the source code directly. Can you copy it to some temporary directory and modify there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

@fbricon fbricon added the debt label Aug 21, 2020
@fbricon fbricon added this to the End August 2020 milestone Aug 21, 2020
Copy link
Collaborator

@fbricon fbricon left a comment

Choose a reason for hiding this comment

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

Change the test so that it doesn't mutate the sources

@jdneo
Copy link
Collaborator Author

jdneo commented Aug 25, 2020

@fbricon Would you mind to tag this PR to a later milestone? I need sometime to figure out if there is some elegant way to prepare the test folder and launch the tests. (Launch from npm run test and VS Code launch configuration have different entrances).

Updated.

Signed-off-by: Sheng Chen <sheche@microsoft.com>
@fbricon fbricon merged commit f29528f into redhat-developer:master Aug 28, 2020
@fbricon
Copy link
Collaborator

fbricon commented Aug 28, 2020

Thanks @jdneo!

@jdneo jdneo deleted the cs/rename-test branch August 29, 2020 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants