Skip to content

Commit 9edcc86

Browse files
committed
test: use istanbul coverage provider
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 14f52a2 commit 9edcc86

File tree

5 files changed

+78
-110
lines changed

5 files changed

+78
-110
lines changed

apps/federatedfilesharing/src/components/RemoteShareDialog.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('RemoteShareDialog', () => {
4141
},
4242
})
4343

44-
await expect(findByLabelText(component.element, 'Remote share password')).rejects.toThrow()
44+
await expect(findByLabelText(document.body, 'Remote share password')).rejects.toThrow()
4545
})
4646

4747
it('emits true when accepted', async () => {
@@ -59,7 +59,7 @@ describe('RemoteShareDialog', () => {
5959
},
6060
})
6161

62-
const button = getByRole(component.element, 'button', { name: 'Cancel' })
62+
const button = getByRole(document.body, 'button', { name: 'Cancel' })
6363
await fireEvent.click(button)
6464
expect(onClose).toHaveBeenCalledWith(false)
6565
})
@@ -74,7 +74,7 @@ describe('RemoteShareDialog', () => {
7474
},
7575
})
7676

77-
await expect(findByLabelText(component.element, 'Remote share password')).resolves.not.toThrow()
77+
await expect(findByLabelText(document.body, 'Remote share password')).resolves.not.toThrow()
7878
})
7979

8080
it('emits the submitted password', async () => {
@@ -92,9 +92,9 @@ describe('RemoteShareDialog', () => {
9292
},
9393
})
9494

95-
const input = getByLabelText(component.element, 'Remote share password')
95+
const input = getByLabelText(document.body, 'Remote share password')
9696
await fireEvent.update(input, 'my password')
97-
const button = getByRole(component.element, 'button', { name: 'Add remote share' })
97+
const button = getByRole(document.body, 'button', { name: 'Add remote share' })
9898
await fireEvent.click(button)
9999
expect(onClose).toHaveBeenCalledWith(true, 'my password')
100100
})
@@ -114,9 +114,9 @@ describe('RemoteShareDialog', () => {
114114
},
115115
})
116116

117-
const input = getByLabelText(component.element, 'Remote share password')
117+
const input = getByLabelText(document.body, 'Remote share password')
118118
await fireEvent.update(input, 'my password')
119-
const button = getByRole(component.element, 'button', { name: 'Cancel' })
119+
const button = getByRole(document.body, 'button', { name: 'Cancel' })
120120
await fireEvent.click(button)
121121
expect(onClose).toHaveBeenCalledWith(false)
122122
})

build/frontend-legacy/vitest.config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default defineConfig({
5757
coverage: {
5858
include: ['./apps/*/src/**', 'core/src/**'],
5959
exclude: ['**.spec.*', '**.test.*', '**.cy.*', 'core/src/tests/**'],
60-
provider: 'v8',
60+
provider: 'istanbul',
6161
reporter: ['lcov', 'text'],
6262
reportsDirectory: resolve(import.meta.dirname, '../../coverage/legacy'),
6363
},
@@ -74,7 +74,7 @@ export default defineConfig({
7474
deps: {
7575
// @see https://github.com/vitest-dev/vitest/issues/7950
7676
// inline: true,
77-
inline: [ /^(?!.*vitest).*$/ ],
77+
inline: [/^(?!.*vitest).*$/],
7878
},
7979
},
8080
},

build/frontend/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default defineConfig({
5454
/* 'core/src/**', */
5555
],
5656
exclude: ['**.spec.*', '**.test.*', '**.cy.*', 'core/src/tests/**'],
57-
provider: 'v8',
57+
provider: 'istanbul',
5858
reporter: ['lcov', 'text'],
5959
reportsDirectory: resolve(import.meta.dirname, '../../coverage'),
6060
},

0 commit comments

Comments
 (0)