Skip to content

Commit 9e276c3

Browse files
authored
test: clean up vitest output (#738)
1 parent e3f6bec commit 9e276c3

File tree

7 files changed

+27
-6
lines changed

7 files changed

+27
-6
lines changed

app/components/Header/AuthModal.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async function handleLogin() {
8787
{{ $t('auth.modal.what_is_atmosphere') }}
8888
</summary>
8989
<div class="mt-3">
90-
<i18n-t keypath="auth.modal.atmosphere_explanation" tag="p">
90+
<i18n-t keypath="auth.modal.atmosphere_explanation" tag="p" scope="global">
9191
<template #npmx>
9292
<span class="font-bold">npmx.dev</span>
9393
</template>

app/components/Header/ConnectorModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function handleDisconnect() {
8888
{{ $t('connector.modal.contributor_badge') }}
8989
</span>
9090
<p class="text-sm text-fg-muted">
91-
<i18n-t keypath="connector.modal.contributor_notice">
91+
<i18n-t keypath="connector.modal.contributor_notice" scope="global">
9292
<template #link>
9393
<a
9494
href="https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"

app/components/Package/SkillsModal.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ function getWarningTooltip(skill: SkillListItem): string | undefined {
9595
v-if="selectedMethod === 'skills-npm'"
9696
class="flex items-center justify-between gap-2 px-3 py-2.5 sm:px-4 bg-bg-subtle border border-border rounded-lg mb-5"
9797
>
98-
<i18n-t keypath="package.skills.compatible_with" tag="span" class="text-sm text-fg-muted">
98+
<i18n-t
99+
keypath="package.skills.compatible_with"
100+
tag="span"
101+
class="text-sm text-fg-muted"
102+
scope="global"
103+
>
99104
<template #tool>
100105
<code class="font-mono text-fg">skills-npm</code>
101106
</template>

test/nuxt/a11y.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,9 @@ describe('component accessibility audits', () => {
17061706
describe('Readme', () => {
17071707
it('should have no accessibility violations with slot content', async () => {
17081708
const component = await mountSuspended(Readme, {
1709-
slots: { default: '<h3>README</h3><p>Some content</p>' },
1709+
props: {
1710+
html: '<h3>README</h3><p>Some content</p>',
1711+
},
17101712
})
17111713
const results = await runAxe(component)
17121714
expect(results.violations).toEqual([])

test/unit/cli/server.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import { describe, expect, it } from 'vitest'
1+
import { describe, expect, it, vi } from 'vitest'
22
import { createConnectorApp } from '../../../cli/src/server.ts'
33

44
const TEST_TOKEN = 'test-token-123'
5+
vi.mock('../../../cli/src/logger.ts', () => {
6+
return {
7+
logError: () => {},
8+
logDebug: () => {},
9+
}
10+
})
511

612
describe('connector server', () => {
713
describe('GET /team/:scopeTeam/users', () => {

test/unit/server/utils/dependency-analysis.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ describe('dependency-analysis', () => {
7676
})
7777

7878
it('tracks failed queries when OSV batch API fails', async () => {
79+
// Suppress expected console output from error path
80+
vi.spyOn(console, 'warn').mockImplementation(() => {})
81+
vi.spyOn(console, 'error').mockImplementation(() => {})
82+
7983
const mockResolved = new Map([
8084
[
8185
'test-pkg@1.0.0',

vitest.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,20 @@ export default defineConfig({
3131
rootDir: fileURLToPath(new URL('.', import.meta.url)),
3232
overrides: {
3333
experimental: {
34+
payloadExtraction: false,
3435
viteEnvironmentApi: false,
3536
},
37+
pwa: {
38+
pwaAssets: { disabled: true },
39+
},
3640
ogImage: { enabled: false },
3741
},
3842
},
3943
},
4044
browser: {
4145
enabled: true,
4246
provider: playwright(),
43-
instances: [{ browser: 'chromium' }],
47+
instances: [{ browser: 'chromium', headless: true }],
4448
},
4549
},
4650
}),

0 commit comments

Comments
 (0)