Skip to content

Commit

Permalink
test: add test for empty settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Oct 3, 2024
1 parent 8fe73ad commit 472912a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/language-server/test/typescript/renames.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ describe('TypeScript - Renaming', async () => {

before(async () => (languageServer = await getLanguageServer()));

it('Renames imports for files when setting is not set', async () => {
const documentToBeRenamed = await languageServer.handle.openTextDocument(
path.resolve(fixtureDir, 'renameThis.ts'),
'typescript',
);

const newUri = documentToBeRenamed.uri.replace('renameThis.ts', 'renamed.ts');

const edits = await languageServer.handle.connection.sendRequest(WillRenameFilesRequest.type, {
files: [
{
oldUri: documentToBeRenamed.uri,
newUri: newUri,
},
],
});

expect(edits).to.not.be.null;
});

it('Does not rename imports for files when setting is disabled', async () => {
await languageServer.handle.updateConfiguration({
astro: {
Expand Down

0 comments on commit 472912a

Please sign in to comment.