Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/lsp-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1399,11 +1399,13 @@ describe('LSPClient', () => {
describe('incomingCalls', () => {
it('should return incoming calls using uriToPath', async () => {
const client = new LSPClient(TEST_CONFIG_PATH);
const testFilePath = join(TEST_DIR, 'test.ts');
const callerFilePath = join(TEST_DIR, 'caller1.ts');

const mockItem = {
name: 'testFunction',
kind: 12, // Function
uri: pathToUri('/test.ts'),
uri: pathToUri(testFilePath),
range: {
start: { line: 0, character: 0 },
end: { line: 0, character: 20 },
Expand All @@ -1419,7 +1421,7 @@ describe('LSPClient', () => {
from: {
name: 'caller1',
kind: 12,
uri: pathToUri('/caller1.ts'),
uri: pathToUri(callerFilePath),
range: {
start: { line: 5, character: 0 },
end: { line: 5, character: 10 },
Expand Down Expand Up @@ -1472,11 +1474,12 @@ describe('LSPClient', () => {

it('should return empty array when no incoming calls', async () => {
const client = new LSPClient(TEST_CONFIG_PATH);
const testFilePath = join(TEST_DIR, 'test.ts');

const mockItem = {
name: 'testFunction',
kind: 12,
uri: pathToUri('/test.ts'),
uri: pathToUri(testFilePath),
range: {
start: { line: 0, character: 0 },
end: { line: 0, character: 20 },
Expand Down Expand Up @@ -1517,11 +1520,13 @@ describe('LSPClient', () => {
describe('outgoingCalls', () => {
it('should return outgoing calls using uriToPath', async () => {
const client = new LSPClient(TEST_CONFIG_PATH);
const testFilePath = join(TEST_DIR, 'test.ts');
const calleeFilePath = join(TEST_DIR, 'callee1.ts');

const mockItem = {
name: 'testFunction',
kind: 12, // Function
uri: pathToUri('/test.ts'),
uri: pathToUri(testFilePath),
range: {
start: { line: 0, character: 0 },
end: { line: 0, character: 20 },
Expand All @@ -1537,7 +1542,7 @@ describe('LSPClient', () => {
to: {
name: 'callee1',
kind: 12,
uri: pathToUri('/callee1.ts'),
uri: pathToUri(calleeFilePath),
range: {
start: { line: 10, character: 0 },
end: { line: 10, character: 15 },
Expand Down Expand Up @@ -1590,11 +1595,12 @@ describe('LSPClient', () => {

it('should return empty array when no outgoing calls', async () => {
const client = new LSPClient(TEST_CONFIG_PATH);
const testFilePath = join(TEST_DIR, 'test.ts');

const mockItem = {
name: 'testFunction',
kind: 12,
uri: pathToUri('/test.ts'),
uri: pathToUri(testFilePath),
range: {
start: { line: 0, character: 0 },
end: { line: 0, character: 20 },
Expand Down