[READ-ONLY] a fast, modern browser for the npm registry
at main 27 lines 793 B view raw
1import { describe, expect, it } from 'vitest' 2import { 3 SHOWCASED_FRAMEWORKS, 4 getFrameworkColor, 5 isListedFramework, 6 type ShowcasedFramework, 7} from '../../../../app/utils/frameworks' 8 9describe('getFrameworkColor', () => { 10 it('returns the color a listed framework', () => { 11 SHOWCASED_FRAMEWORKS.forEach((framework: ShowcasedFramework) => { 12 expect(getFrameworkColor(framework.package)).toBe(framework.color) 13 }) 14 }) 15}) 16 17describe('isListedFramework', () => { 18 it('returns true for a listed framework', () => { 19 SHOWCASED_FRAMEWORKS.forEach((framework: ShowcasedFramework) => { 20 expect(isListedFramework(framework.package)).toBe(true) 21 }) 22 }) 23 24 it('returns false for non listed frameworks', () => { 25 expect(isListedFramework('leftpad')).toBe(false) 26 }) 27})