-
-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathnpm-utils.spec.ts
More file actions
17 lines (14 loc) · 727 Bytes
/
npm-utils.spec.ts
File metadata and controls
17 lines (14 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { describe, expect, it } from 'vitest'
import { buildScopeTeam } from '../../app/utils/npm'
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('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()
})
})