File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest' ;
2+
3+ import { LANGUAGE_COLORS } from './languageColors' ;
4+
5+ describe ( 'LANGUAGE_COLORS' , ( ) => {
6+ it ( 'contains the correct TypeScript color' , ( ) => {
7+ expect ( LANGUAGE_COLORS . TypeScript ) . toBe ( '#3178c6' ) ;
8+ } ) ;
9+
10+ it ( 'contains the correct JavaScript color' , ( ) => {
11+ expect ( LANGUAGE_COLORS . JavaScript ) . toBe ( '#f1e05a' ) ;
12+ } ) ;
13+
14+ it ( 'defines Python color' , ( ) => {
15+ expect ( LANGUAGE_COLORS . Python ) . toBeDefined ( ) ;
16+ } ) ;
17+
18+ it ( 'uses valid 6-digit hex colors for every language' , ( ) => {
19+ for ( const color of Object . values ( LANGUAGE_COLORS ) ) {
20+ expect ( color ) . toMatch ( / ^ # [ 0 - 9 a - f A - F ] { 6 } $ / ) ;
21+ }
22+ } ) ;
23+
24+ it ( 'contains at least 20 languages' , ( ) => {
25+ expect ( Object . keys ( LANGUAGE_COLORS ) . length ) . toBeGreaterThanOrEqual ( 20 ) ;
26+ } ) ;
27+
28+ it ( 'does not contain empty language names' , ( ) => {
29+ for ( const language of Object . keys ( LANGUAGE_COLORS ) ) {
30+ expect ( language . trim ( ) ) . not . toBe ( '' ) ;
31+ }
32+ } ) ;
33+ } ) ;
You can’t perform that action at this time.
0 commit comments