@@ -86,4 +86,53 @@ describe('Theme', () => {
8686 chalk . white ( 'text' ) ) ;
8787 } ) ;
8888 } ) ;
89+
90+ describe ( 'Rendering with distinct colors for each token type' , ( ) => {
91+
92+ let theme = new Theme ( {
93+ commandName : 'greenBright, bold' ,
94+ mainDescription : 'greenBright, bold' ,
95+ exampleDescription : 'greenBright' ,
96+ exampleCode : 'redBright' ,
97+ exampleBool : 'magenta' ,
98+ exampleNumber : 'white' ,
99+ exampleString : 'blue'
100+ } ) ;
101+
102+ it ( 'should render name with greenBright and bold' , ( ) => {
103+ theme . renderCommandName ( 'text' )
104+ . should . equal (
105+ chalk . greenBright . bold ( 'text' ) ) ;
106+ } ) ;
107+
108+ it ( 'should render description with greenBright and bold' , ( ) => {
109+ theme . renderMainDescription ( 'text' )
110+ . should . equal (
111+ chalk . greenBright . bold ( 'text' ) ) ;
112+ } ) ;
113+
114+ it ( 'should render example description with greenBright' , ( ) => {
115+ theme . renderExampleDescription ( 'text' )
116+ . should . equal (
117+ chalk . greenBright ( 'text' ) ) ;
118+ } ) ;
119+
120+ it ( 'should render example code with redBright' , ( ) => {
121+ theme . renderExampleCode ( 'text' )
122+ . should . equal (
123+ chalk . redBright ( 'text' ) ) ;
124+ } ) ;
125+
126+ it ( 'should render example arguments with magenta, white, and blue, for boolean, number, and string respectively' , ( ) => {
127+ theme . renderExampleToken ( 'true' )
128+ . should . equal (
129+ chalk . magenta ( 'true' ) ) ;
130+ theme . renderExampleToken ( '9' )
131+ . should . equal (
132+ chalk . white ( '9' ) ) ;
133+ theme . renderExampleToken ( 'text' )
134+ . should . equal (
135+ chalk . blue ( 'text' ) ) ;
136+ } ) ;
137+ } ) ;
89138} ) ;
0 commit comments