Skip to content

Commit

Permalink
Update tests for monorepo workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed May 20, 2024
1 parent 5ecde0d commit e935371
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions packages/language-server/tests/custom-workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const settings: Settings = {
withFixture('monorepo', async (context) => {
test.concurrent('workspaces', async ({ expect }) => {
expect(context.server.workspaces.length).toBe(2)
expect(context.server.workspaces).toMatchObject([
{ path: resolve('tests/fixtures/monorepo') },
{ path: resolve('tests/fixtures/monorepo/c') },
])
expect(context.server.workspaces).toEqual(
expect.arrayContaining([
expect.objectContaining({ path: resolve('tests/fixtures/monorepo') }),
expect.objectContaining({ path: resolve('tests/fixtures/monorepo/c') }),
])
)
})
}, settings)
12 changes: 7 additions & 5 deletions packages/language-server/tests/monorepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { test } from 'vitest'
withFixture('monorepo', async (context) => {
test.concurrent('workspaces', async ({ expect }) => {
expect(context.server.workspaces.length).toBe(3)
expect(context.server.workspaces).toMatchObject([
{ path: resolve('tests/fixtures/monorepo') },
{ path: resolve('tests/fixtures/monorepo/a') },
{ path: resolve('tests/fixtures/monorepo/b') },
])
expect(context.server.workspaces).toEqual(
expect.arrayContaining([
expect.objectContaining({ path: resolve('tests/fixtures/monorepo') }),
expect.objectContaining({ path: resolve('tests/fixtures/monorepo/a') }),
expect.objectContaining({ path: resolve('tests/fixtures/monorepo/b') }),
])
)
})

test('open a document and link it to the nearest workspace', async ({ expect }) => {
Expand Down

0 comments on commit e935371

Please sign in to comment.