= {
// Complex components requiring full app context or specific runtime conditions
'Header/OrgsDropdown.vue': 'Requires connector context and API calls',
'Header/PackagesDropdown.vue': 'Requires connector context and API calls',
- 'Header/MobileMenu.client.vue': 'Requires Teleport and full navigation context',
+ 'Header/MobileMenu.vue': 'Requires Teleport and full navigation context',
'Modal.client.vue':
'Base modal component - tested via specific modals like ChartModal, ConnectorModal',
'Package/SkillsModal.vue': 'Complex modal with tabs - requires modal context and state',
diff --git a/test/unit/app/utils/colors.spec.ts b/test/unit/app/utils/colors.spec.ts
deleted file mode 100644
index 7dcb1fb578..0000000000
--- a/test/unit/app/utils/colors.spec.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { lightenHex, oklchToHex, transparentizeOklch } from '../../../../app/utils/colors'
-
-describe('lightenHex', () => {
- it('lightens a color by the default factor (0.5)', () => {
- expect(lightenHex('#000000')).toBe('#808080')
- })
-
- it('lightens a color by a custom factor', () => {
- expect(lightenHex('#000000', 0.25)).toBe('#404040')
- expect(lightenHex('#000000', 0.75)).toBe('#bfbfbf')
- expect(lightenHex('#000000', 1)).toBe('#ffffff')
- })
-
- it('returns white when factor is 1', () => {
- expect(lightenHex('#ff0000', 1)).toBe('#ffffff')
- expect(lightenHex('#123456', 1)).toBe('#ffffff')
- })
-
- it('returns the original color when factor is 0', () => {
- expect(lightenHex('#ff0000', 0)).toBe('#ff0000')
- expect(lightenHex('#123456', 0)).toBe('#123456')
- })
-
- it('lightens each channel independently', () => {
- // #ff0000 at 0.5 -> r: 255+(0)*0.5=255, g: 0+(255)*0.5=128, b: 0+(255)*0.5=128
- expect(lightenHex('#ff0000', 0.5)).toBe('#ff8080')
- })
-
- it('returns the input unchanged for an invalid hex', () => {
- expect(lightenHex('not-a-color')).toBe('not-a-color')
- })
-
- it('handles hex without leading #', () => {
- expect(lightenHex('000000', 0.5)).toBe('#808080')
- })
-})
-
-describe('oklchToHex', () => {
- it('converts pure black', () => {
- expect(oklchToHex('oklch(0 0 0)')).toMatchInlineSnapshot(`"#000000"`)
- })
-
- it('converts pure white', () => {
- expect(oklchToHex('oklch(1 0 0)')).toMatchInlineSnapshot(`"#ffffff"`)
- })
-
- it('converts a saturated red', () => {
- expect(oklchToHex('oklch(0.628 0.258 29.23)')).toMatchInlineSnapshot(`"#ff0000"`)
- })
-
- it('converts a saturated green', () => {
- expect(oklchToHex('oklch(0.866 0.295 142.5)')).toMatchInlineSnapshot(`"#00ff00"`)
- })
-
- it('converts a saturated blue', () => {
- expect(oklchToHex('oklch(0.452 0.313 264.05)')).toMatchInlineSnapshot(`"#0000ff"`)
- })
-
- it('converts the neutral fallback color', () => {
- expect(oklchToHex('oklch(0.633 0 0)')).toMatchInlineSnapshot(`"#8a8a8a"`)
- })
-
- it('returns null for null input', () => {
- expect(oklchToHex(null)).toBeNull()
- })
-
- it('returns undefined for undefined input', () => {
- expect(oklchToHex(undefined)).toBeUndefined()
- })
-
- it('throws on invalid format', () => {
- expect(() => oklchToHex('not-a-color')).toThrow('Invalid OKLCH color format')
- })
-})
-
-describe('transparentizeOklch', () => {
- it('makes a color 50% transparent', () => {
- expect(transparentizeOklch('oklch(0.5 0.2 120)', 0.5)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 0.5)"`,
- )
- })
-
- it('makes a color fully transparent (factor 1)', () => {
- expect(transparentizeOklch('oklch(0.5 0.2 120)', 1)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 0)"`,
- )
- })
-
- it('keeps a color fully opaque (factor 0)', () => {
- expect(transparentizeOklch('oklch(0.5 0.2 120)', 0)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 1)"`,
- )
- })
-
- it('reduces existing alpha', () => {
- expect(transparentizeOklch('oklch(0.5 0.2 120 / 0.8)', 0.5)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 0.4)"`,
- )
- })
-
- it('handles percentage lightness and alpha', () => {
- expect(transparentizeOklch('oklch(50% 0.2 120 / 80%)', 0.5)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 0.4)"`,
- )
- })
-
- it('clamps factor to [0, 1]', () => {
- expect(transparentizeOklch('oklch(0.5 0.2 120)', 2)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 0)"`,
- )
- expect(transparentizeOklch('oklch(0.5 0.2 120)', -1)).toMatchInlineSnapshot(
- `"oklch(0.5 0.2 120 / 1)"`,
- )
- })
-
- it('returns fallback for null input', () => {
- expect(transparentizeOklch(null, 0.5)).toBe('oklch(0 0 0 / 0)')
- })
-
- it('returns fallback for undefined input', () => {
- expect(transparentizeOklch(undefined, 0.5)).toBe('oklch(0 0 0 / 0)')
- })
-
- it('returns fallback for empty string', () => {
- expect(transparentizeOklch('', 0.5)).toBe('oklch(0 0 0 / 0)')
- })
-
- it('returns fallback for invalid format', () => {
- expect(transparentizeOklch('not-a-color', 0.5)).toBe('oklch(0 0 0 / 0)')
- })
-
- it('uses custom fallback', () => {
- expect(transparentizeOklch(null, 0.5, 'oklch(1 0 0 / 0)')).toBe('oklch(1 0 0 / 0)')
- })
-})
diff --git a/test/unit/app/utils/file-icons.spec.ts b/test/unit/app/utils/file-icons.spec.ts
deleted file mode 100644
index 7e6fd08493..0000000000
--- a/test/unit/app/utils/file-icons.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { getFileIcon } from '../../../../app/utils/file-icons'
-
-describe('getFileIcon', () => {
- it('returns correct icons for exact filename matches', () => {
- expect(getFileIcon('package.json')).toBe('i-vscode-icons-file-type-npm')
- expect(getFileIcon('Dockerfile')).toBe('i-vscode-icons-file-type-docker')
- expect(getFileIcon('.gitignore')).toBe('i-vscode-icons-file-type-git')
- expect(getFileIcon('eslint.config.js')).toBe('i-vscode-icons-file-type-eslint')
- expect(getFileIcon('vitest.config.ts')).toBe('i-vscode-icons-file-type-vitest')
- expect(getFileIcon('.env')).toBe('i-vscode-icons-file-type-dotenv')
- })
-
- it('returns correct icons for compound extensions', () => {
- expect(getFileIcon('types.d.ts')).toBe('i-vscode-icons-file-type-typescriptdef')
- expect(getFileIcon('utils.test.ts')).toBe('i-vscode-icons-file-type-testts')
- expect(getFileIcon('utils.spec.js')).toBe('i-vscode-icons-file-type-testjs')
- expect(getFileIcon('Button.stories.tsx')).toBe('i-vscode-icons-file-type-storybook')
- })
-
- it('returns correct icons for simple extensions', () => {
- expect(getFileIcon('index.js')).toBe('i-vscode-icons-file-type-js-official')
- expect(getFileIcon('main.ts')).toBe('i-vscode-icons-file-type-typescript-official')
- expect(getFileIcon('App.vue')).toBe('i-vscode-icons-file-type-vue')
- expect(getFileIcon('data.json')).toBe('i-vscode-icons-file-type-json')
- expect(getFileIcon('build.sh')).toBe('i-vscode-icons-file-type-shell')
- expect(getFileIcon('script.py')).toBe('i-vscode-icons-file-type-python')
- expect(getFileIcon('lib.rs')).toBe('i-vscode-icons-file-type-rust')
- expect(getFileIcon('logo.png')).toBe('i-vscode-icons-file-type-image')
- expect(getFileIcon('archive.tar')).toBe('i-vscode-icons-file-type-zip')
- })
-
- it('returns default icon for unknown files', () => {
- expect(getFileIcon('file.xyz')).toBe('i-vscode-icons-default-file')
- expect(getFileIcon('unknownfile')).toBe('i-vscode-icons-default-file')
- })
-
- it('prefers exact filename over extension, and compound over simple', () => {
- expect(getFileIcon('package.json')).toBe('i-vscode-icons-file-type-npm')
- expect(getFileIcon('foo.test.ts')).toBe('i-vscode-icons-file-type-testts')
- })
-})
diff --git a/test/unit/app/utils/formatters.spec.ts b/test/unit/app/utils/formatters.spec.ts
deleted file mode 100644
index 7ee02c6a14..0000000000
--- a/test/unit/app/utils/formatters.spec.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import {
- decodeHtmlEntities,
- formatBytes,
- formatCompactNumber,
- toIsoDateString,
-} from '../../../../app/utils/formatters'
-
-describe('toIsoDateString', () => {
- it('formats a date as YYYY-MM-DD', () => {
- expect(toIsoDateString(new Date('2024-03-15T00:00:00Z'))).toBe('2024-03-15')
- })
-
- it('pads single-digit month and day', () => {
- expect(toIsoDateString(new Date('2024-01-05T00:00:00Z'))).toBe('2024-01-05')
- })
-})
-
-describe('decodeHtmlEntities', () => {
- it.each([
- ['&', '&'],
- ['<', '<'],
- ['>', '>'],
- ['"', '"'],
- [''', "'"],
- [''', "'"],
- [' ', ' '],
- ] as const)('%s → %s', (input, expected) => {
- expect(decodeHtmlEntities(input)).toBe(expected)
- })
-
- it('decodes multiple entities in one string', () => {
- expect(decodeHtmlEntities('a & b < c')).toBe('a & b < c')
- })
-
- it('leaves plain text unchanged', () => {
- expect(decodeHtmlEntities('say no to bloat')).toBe('say no to bloat')
- })
-
- it('leaves unknown entities unchanged', () => {
- expect(decodeHtmlEntities('&unknown;')).toBe('&unknown;')
- })
-})
-
-describe('formatCompactNumber', () => {
- describe('without options', () => {
- it.each([
- [0, '0'],
- [1, '1'],
- [999, '999'],
- [1000, '1k'],
- [1500, '2k'],
- [10000, '10k'],
- [1000000, '1M'],
- [2500000, '3M'],
- [1000000000, '1B'],
- [1000000000000, '1T'],
- ] as const)('%d → %s', (input, expected) => {
- expect(formatCompactNumber(input)).toBe(expected)
- })
- })
-
- describe('with decimals', () => {
- it.each([
- [1500, 1, '1.5k'],
- [1234567, 2, '1.23M'],
- [1200000, 1, '1.2M'],
- [1000, 2, '1k'],
- ] as const)('%d with %d decimals', (input, decimals, expected) => {
- expect(formatCompactNumber(input, { decimals })).toBe(expected)
- })
- })
-
- describe('with space', () => {
- it('adds space before suffix', () => {
- expect(formatCompactNumber(1500, { space: true })).toBe('2 k')
- })
- })
-
- describe('negative values', () => {
- it.each([
- [-1000, '-1k'],
- [-2500000, '-3M'],
- [-42, '-42'],
- ] as const)('%d → %s', (input, expected) => {
- expect(formatCompactNumber(input)).toBe(expected)
- })
- })
-
- it('handles values below 1000', () => {
- expect(formatCompactNumber(500)).toBe('500')
- })
-})
-
-describe('formatBytes', () => {
- it.each([
- [0, '0 B'],
- [512, '512 B'],
- [1023, '1023 B'],
- [1024, '1.0 kB'],
- [1536, '1.5 kB'],
- [1048576, '1.0 MB'],
- [1572864, '1.5 MB'],
- ] as const)('%d → %s', (input, expected) => {
- expect(formatBytes(input)).toBe(expected)
- })
-})
diff --git a/test/unit/app/utils/npm.spec.ts b/test/unit/app/utils/npm.spec.ts
new file mode 100644
index 0000000000..56bebfb1ab
--- /dev/null
+++ b/test/unit/app/utils/npm.spec.ts
@@ -0,0 +1,52 @@
+import { describe, expect, it } from 'vitest'
+
+import { buildScopeTeam } from '../../../../app/utils/npm'
+import { validateScopeTeam } from '../../../../cli/src/npm-client'
+import { getSpdxLicenseUrl } from '../../../../shared/utils/spdx'
+
+describe('getSpdxLicenseUrl', () => {
+ it('returns SPDX URL for valid license identifiers', () => {
+ expect(getSpdxLicenseUrl('MIT')).toBe('https://spdx.org/licenses/MIT.html')
+ expect(getSpdxLicenseUrl('ISC')).toBe('https://spdx.org/licenses/ISC.html')
+ expect(getSpdxLicenseUrl('Apache-2.0')).toBe('https://spdx.org/licenses/Apache-2.0.html')
+ expect(getSpdxLicenseUrl('GPL-3.0-only')).toBe('https://spdx.org/licenses/GPL-3.0-only.html')
+ expect(getSpdxLicenseUrl('BSD-2-Clause')).toBe('https://spdx.org/licenses/BSD-2-Clause.html')
+ expect(getSpdxLicenseUrl('GPL-3.0+')).toBe('https://spdx.org/licenses/GPL-3.0+.html')
+ })
+
+ it('trims whitespace from license identifiers', () => {
+ expect(getSpdxLicenseUrl(' MIT ')).toBe('https://spdx.org/licenses/MIT.html')
+ })
+
+ it('returns null for undefined or empty', () => {
+ expect(getSpdxLicenseUrl(undefined)).toBeNull()
+ expect(getSpdxLicenseUrl('')).toBeNull()
+ expect(getSpdxLicenseUrl(' ')).toBeNull()
+ })
+
+ it('returns null for invalid license identifiers', () => {
+ // Compound expressions are not in the SPDX list
+ expect(getSpdxLicenseUrl('MIT OR Apache-2.0')).toBeNull()
+ // Non-existent licenses
+ expect(getSpdxLicenseUrl('INVALID-LICENSE')).toBeNull()
+ expect(getSpdxLicenseUrl('Custom')).toBeNull()
+ })
+})
+
+describe('buildScopeTeam', () => {
+ it('constructs scope:team with @ prefix', () => {
+ expect(buildScopeTeam('netlify', 'developers')).toBe('@netlify:developers')
+ expect(buildScopeTeam('nuxt', 'core')).toBe('@nuxt:core')
+ })
+
+ it('strips existing @ prefix from orgName', () => {
+ expect(buildScopeTeam('@netlify', 'developers')).toBe('@netlify:developers')
+ expect(buildScopeTeam('@nuxt', 'core')).toBe('@nuxt:core')
+ })
+
+ it('produces format accepted by validateScopeTeam', () => {
+ expect(() => validateScopeTeam(buildScopeTeam('netlify', 'developers'))).not.toThrow()
+ expect(() => validateScopeTeam(buildScopeTeam('nuxt', 'core'))).not.toThrow()
+ expect(() => validateScopeTeam(buildScopeTeam('my-org', 'my-team'))).not.toThrow()
+ })
+})
diff --git a/test/unit/app/utils/npm/common.spec.ts b/test/unit/app/utils/npm/common.spec.ts
deleted file mode 100644
index c750e83c7c..0000000000
--- a/test/unit/app/utils/npm/common.spec.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, it } from 'vitest'
-
-import { buildScopeTeam } from '../../../../../app/utils/npm/common'
-import { validateScopeTeam } from '../../../../../cli/src/npm-client'
-
-describe('buildScopeTeam', () => {
- it('constructs scope:team with @ prefix', () => {
- expect(buildScopeTeam('netlify', 'developers')).toBe('@netlify:developers')
- expect(buildScopeTeam('nuxt', 'core')).toBe('@nuxt:core')
- })
-
- it('strips existing @ prefix from orgName', () => {
- expect(buildScopeTeam('@netlify', 'developers')).toBe('@netlify:developers')
- expect(buildScopeTeam('@nuxt', 'core')).toBe('@nuxt:core')
- })
-
- it('produces format accepted by validateScopeTeam', () => {
- expect(() => validateScopeTeam(buildScopeTeam('netlify', 'developers'))).not.toThrow()
- expect(() => validateScopeTeam(buildScopeTeam('nuxt', 'core'))).not.toThrow()
- expect(() => validateScopeTeam(buildScopeTeam('my-org', 'my-team'))).not.toThrow()
- })
-})
diff --git a/test/unit/app/utils/versions.spec.ts b/test/unit/app/utils/versions.spec.ts
index cde36f99d1..91d9cb57a0 100644
--- a/test/unit/app/utils/versions.spec.ts
+++ b/test/unit/app/utils/versions.spec.ts
@@ -6,45 +6,11 @@ import {
getPrereleaseChannel,
getVersionGroupKey,
getVersionGroupLabel,
- isExactVersion,
isSameVersionGroup,
parseVersion,
sortTags,
} from '../../../../app/utils/versions'
-describe('isExactVersion', () => {
- it('returns true for stable versions', () => {
- expect(isExactVersion('1.0.0')).toBe(true)
- expect(isExactVersion('0.1.0')).toBe(true)
- expect(isExactVersion('10.20.30')).toBe(true)
- })
-
- it('returns true for prerelease versions', () => {
- expect(isExactVersion('1.0.0-beta.1')).toBe(true)
- expect(isExactVersion('1.0.0-alpha.0')).toBe(true)
- expect(isExactVersion('5.8.0-rc')).toBe(true)
- })
-
- it('returns false for ranges', () => {
- expect(isExactVersion('^1.0.0')).toBe(false)
- expect(isExactVersion('~1.0.0')).toBe(false)
- expect(isExactVersion('>=1.0.0')).toBe(false)
- expect(isExactVersion('1.0.x')).toBe(false)
- expect(isExactVersion('*')).toBe(false)
- })
-
- it('returns false for dist-tags', () => {
- expect(isExactVersion('latest')).toBe(false)
- expect(isExactVersion('next')).toBe(false)
- expect(isExactVersion('beta')).toBe(false)
- })
-
- it('returns false for invalid strings', () => {
- expect(isExactVersion('')).toBe(false)
- expect(isExactVersion('not-a-version')).toBe(false)
- })
-})
-
describe('parseVersion', () => {
it('parses stable versions', () => {
expect(parseVersion('1.2.3')).toEqual({
diff --git a/test/unit/server/utils/docs/text.spec.ts b/test/unit/server/utils/docs/text.spec.ts
index a928d45fe7..6b77bb7745 100644
--- a/test/unit/server/utils/docs/text.spec.ts
+++ b/test/unit/server/utils/docs/text.spec.ts
@@ -1,5 +1,4 @@
import { describe, expect, it } from 'vitest'
-import * as fc from 'fast-check'
import {
escapeHtml,
parseJsDocLinks,
@@ -41,15 +40,6 @@ describe('stripAnsi', () => {
const input = `object is ReactElement${ESC}[0m${ESC}[38;5;12m<${ESC}[0mP${ESC}[38;5;12m>${ESC}[0m`
expect(stripAnsi(input)).toBe('object is ReactElement')
})
-
- it('should strip everything in one pass', () => {
- fc.assert(
- fc.property(fc.string(), input => {
- const stripped = stripAnsi(input)
- expect(stripAnsi(stripped)).toBe(stripped)
- }),
- )
- })
})
describe('escapeHtml', () => {
@@ -134,65 +124,6 @@ describe('parseJsDocLinks', () => {
const result = parseJsDocLinks('{@link http://example.com}', emptyLookup)
expect(result).toContain('href="http://example.com"')
})
-
- it('should convert external URLs using {@link url} to links', () => {
- fc.assert(
- fc.property(fc.webUrl(), url => {
- const result = parseJsDocLinks(`{@link ${url}}`, emptyLookup)
- expect(result).toContain(`href="${escapeHtml(url)}"`)
- expect(result).toContain('target="_blank"')
- expect(result).toContain('rel="noreferrer"')
- expect(result).toContain(escapeHtml(url))
- }),
- )
- })
-
- it('should convert external URLs using {@link url text} to links', () => {
- fc.assert(
- fc.property(fc.webUrl(), fc.stringMatching(/^[^}\s][^}]+[^}\s]$/), (url, text) => {
- const result = parseJsDocLinks(`{@link ${url} ${text}}`, emptyLookup)
- expect(result).toContain(`href="${escapeHtml(url)}"`)
- expect(result).toContain('target="_blank"')
- expect(result).toContain('rel="noreferrer"')
- expect(result).toContain(escapeHtml(text))
- }),
- )
- })
-
- it('should be able to treat correctly several external URLs at the middle of a text', () => {
- const surrounding = fc.stringMatching(/^[^{]*$/)
- const link = fc.record({
- url: fc.webUrl(),
- label: fc.option(fc.stringMatching(/^[^}\s][^}]+[^}\s]$/)),
- before: surrounding,
- after: surrounding,
- })
- fc.assert(
- fc.property(fc.array(link, { minLength: 1 }), content => {
- let docString = ''
- const expectedUrls = []
- for (const chunk of content) {
- if (chunk.before.length !== 0 || docString.length !== 0) {
- docString += `${chunk.before} `
- }
- if (chunk.label === null) {
- docString += `{@link ${chunk.url}}`
- expectedUrls.push(chunk.url)
- } else {
- docString += `{@link ${chunk.url} ${chunk.label}}`
- expectedUrls.push(chunk.url)
- }
- if (chunk.after.length !== 0) {
- docString += ` ${chunk.after}`
- }
- }
- const result = parseJsDocLinks(docString, emptyLookup)
- for (const url of expectedUrls) {
- expect(result).toContain(`href="${escapeHtml(url)}"`)
- }
- }),
- )
- })
})
describe('renderMarkdown', () => {
diff --git a/test/unit/shared/utils/async.spec.ts b/test/unit/shared/utils/async.spec.ts
index 8c2104e4c4..227460781c 100644
--- a/test/unit/shared/utils/async.spec.ts
+++ b/test/unit/shared/utils/async.spec.ts
@@ -1,5 +1,4 @@
import { describe, expect, it, vi } from 'vitest'
-import * as fc from 'fast-check'
import { mapWithConcurrency } from '../../../../shared/utils/async'
describe('mapWithConcurrency', () => {
@@ -93,44 +92,4 @@ describe('mapWithConcurrency', () => {
// Should only have 3 concurrent since we only have 3 items
expect(maxConcurrent).toBe(3)
})
-
- it('waits for all tasks to succeed and return them in order whatever their count and the concurrency', async () => {
- await fc.assert(
- fc.asyncProperty(
- fc.array(fc.anything()),
- fc.integer({ min: 1 }),
- fc.scheduler(),
- async (items, concurrency, s) => {
- const fn = s.scheduleFunction(async item => item)
- const results = await s.waitFor(mapWithConcurrency(items, fn, concurrency))
- expect(results).toEqual(items)
- },
- ),
- )
- })
-
- it('not run more than concurrency tasks in parallel', async () => {
- await fc.assert(
- fc.asyncProperty(
- fc.array(fc.anything()),
- fc.integer({ min: 1 }),
- fc.scheduler(),
- async (items, concurrency, s) => {
- let tooManyRunningTasksEncountered = false
- let currentlyRunning = 0
- const fn = async (item: (typeof items)[number]) => {
- currentlyRunning++
- if (currentlyRunning > concurrency) {
- tooManyRunningTasksEncountered = true
- }
- const task = s.schedule(Promise.resolve(item))
- task.then(() => currentlyRunning--) // this task always succeeds by construct
- return task
- }
- await s.waitFor(mapWithConcurrency(items, fn, concurrency))
- expect(tooManyRunningTasksEncountered).toBe(false)
- },
- ),
- )
- })
})
diff --git a/test/unit/shared/utils/binary-detection.spec.ts b/test/unit/shared/utils/binary-detection.spec.ts
deleted file mode 100644
index f0b0f8c85d..0000000000
--- a/test/unit/shared/utils/binary-detection.spec.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { isBinaryOnlyPackage, isCreatePackage } from '../../../../shared/utils/binary-detection'
-
-describe('binary-detection', () => {
- describe('isCreatePackage', () => {
- it('returns true for create-* packages', () => {
- expect(isCreatePackage('create-vite')).toBe(true)
- expect(isCreatePackage('create-svelte-app')).toBe(true)
- expect(isCreatePackage('create-lit-app')).toBe(true)
- })
-
- it('returns true for scoped create-* packages', () => {
- expect(isCreatePackage('@lit/create-lit')).toBe(true)
- expect(isCreatePackage('@scope/create-something')).toBe(true)
- })
-
- it('returns false for non-create packages', () => {
- expect(isCreatePackage('vite')).toBe(false)
- expect(isCreatePackage('lit')).toBe(false)
- expect(isCreatePackage('my-create-tool')).toBe(false)
- })
-
- it('returns false for scoped non-create packages', () => {
- expect(isCreatePackage('@scope/some-package')).toBe(false)
- })
- })
-
- describe('isBinaryOnlyPackage', () => {
- it('returns true for create-* packages regardless of fields', () => {
- expect(isBinaryOnlyPackage({ name: 'create-vite' })).toBe(true)
- expect(isBinaryOnlyPackage({ name: 'create-vite', main: './index.js' })).toBe(true)
- })
-
- it('returns true for scoped create-* packages', () => {
- expect(isBinaryOnlyPackage({ name: '@lit/create-lit' })).toBe(true)
- })
-
- it('returns true for packages with bin but no entry points', () => {
- expect(isBinaryOnlyPackage({ name: 'eslint', bin: './bin/eslint.js' })).toBe(true)
- expect(
- isBinaryOnlyPackage({
- name: 'typescript',
- bin: { tsc: './bin/tsc', tsserver: './bin/tsserver' },
- }),
- ).toBe(true)
- })
-
- it('returns false for packages with bin and main', () => {
- expect(
- isBinaryOnlyPackage({
- name: 'eslint',
- bin: './bin/eslint.js',
- main: './lib/index.js',
- }),
- ).toBe(false)
- })
-
- it('returns false for packages with bin and module', () => {
- expect(
- isBinaryOnlyPackage({
- name: 'some-pkg',
- bin: './bin/cli.js',
- module: './dist/index.mjs',
- }),
- ).toBe(false)
- })
-
- it('returns false for packages with bin and exports', () => {
- expect(
- isBinaryOnlyPackage({
- name: 'some-pkg',
- bin: './bin/cli.js',
- exports: { '.': './dist/index.js' },
- }),
- ).toBe(false)
- })
-
- it('returns false for packages with no bin and no entry points', () => {
- expect(isBinaryOnlyPackage({ name: 'some-pkg' })).toBe(false)
- })
-
- it('returns false for packages with empty bin object', () => {
- expect(isBinaryOnlyPackage({ name: 'some-pkg', bin: {} })).toBe(false)
- })
-
- it('returns false for library-only packages', () => {
- expect(isBinaryOnlyPackage({ name: 'lodash', main: './lodash.js' })).toBe(false)
- })
- })
-})
diff --git a/test/unit/shared/utils/spdx.spec.ts b/test/unit/shared/utils/spdx.spec.ts
index 05c3a5c6d3..4d4e944933 100644
--- a/test/unit/shared/utils/spdx.spec.ts
+++ b/test/unit/shared/utils/spdx.spec.ts
@@ -25,25 +25,19 @@ describe('spdx utilities', () => {
})
describe('getSpdxLicenseUrl', () => {
- it('returns URL for valid license identifiers', () => {
+ it('returns URL for valid SPDX licenses', () => {
expect(getSpdxLicenseUrl('MIT')).toBe('https://spdx.org/licenses/MIT.html')
- expect(getSpdxLicenseUrl('ISC')).toBe('https://spdx.org/licenses/ISC.html')
expect(getSpdxLicenseUrl('Apache-2.0')).toBe('https://spdx.org/licenses/Apache-2.0.html')
- expect(getSpdxLicenseUrl('GPL-3.0-only')).toBe('https://spdx.org/licenses/GPL-3.0-only.html')
- expect(getSpdxLicenseUrl('BSD-2-Clause')).toBe('https://spdx.org/licenses/BSD-2-Clause.html')
- expect(getSpdxLicenseUrl('GPL-3.0+')).toBe('https://spdx.org/licenses/GPL-3.0+.html')
})
it('returns null for invalid licenses', () => {
expect(getSpdxLicenseUrl('CustomLicense')).toBeNull()
expect(getSpdxLicenseUrl('INVALID')).toBeNull()
- expect(getSpdxLicenseUrl('MIT OR Apache-2.0')).toBeNull()
})
it('returns null for undefined or empty', () => {
expect(getSpdxLicenseUrl(undefined)).toBeNull()
expect(getSpdxLicenseUrl('')).toBeNull()
- expect(getSpdxLicenseUrl(' ')).toBeNull()
})
it('trims whitespace', () => {
diff --git a/uno.config.ts b/uno.config.ts
index f49fd3ab0a..d4aed7116b 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -120,7 +120,7 @@ export default defineConfig({
shortcuts: [
// Layout
['container', 'max-w-6xl mx-auto px-4 sm:px-6'],
- ['container-sm', 'max-w-5xl mx-auto px-4 sm:px-6'],
+ ['container-sm', 'max-w-4xl mx-auto px-4 sm:px-6'],
// Focus states - subtle but accessible
['focus-ring', 'outline-none focus-visible:(ring-2 ring-fg/10 ring-offset-2)'],