Projects STRLCPY cfonts Commits d0e5c7d3
🤬
  • ■ ■ ■ ■ ■
    README.md
    skipped 157 lines
    158 158  This is the font face you want to use. So far this plugin ships with with following font faces:
    159 159   
    160 160  ```shell
    161  -$ cfonts "text" -f "chrome"
     161 +$ cfonts "text" --font "chrome"
    162 162  ```
    163 163   
    164 164  ![Font command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/font.png)
    skipped 29 lines
    194 194  - `right`
    195 195   
    196 196  ```shell
    197  -$ cfonts "text" -a "center"
     197 +$ cfonts "text" --align "center"
    198 198  ```
    199 199   
    200 200  ![Align command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/align.png)
    skipped 43 lines
    244 244  With this setting you can set a gradient over your output.
    245 245  This setting supersedes the color open.
    246 246  The gradient requires two colors, a start color and an end color from left to right.
     247 +_(If you want to set your own colors for the gradient, use the [transition](#-t---transition-gradient) option.)_
    247 248  CFonts will then generate a gradient through as many colors as it can find to make the output most impressive.
    248 249  Provide two colors in a comma-separated string, eg: `red,blue`. _(no spaces)_
    249 250  If you use a hex color make sure you include the `#` prefix. _(In the terminal wrap the hex in quotes)_
    skipped 23 lines
    273 274  Default value: `false`
    274 275   
    275 276  Set this option to re-calculate the gradient colors for each new line.
     277 +Only works in combination with the [gradient](#-g---gradient) option.
    276 278   
    277 279  ```shell
    278 280  $ cfonts "text|next line" --gradient red,"#f80" --independentGradient
    skipped 2 lines
    281 283  ![Independent gradient command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/independent-gradient.png)
    282 284   
    283 285   
     286 +#### -t, --transition-gradient
     287 +Type: `<boolean>`
     288 +Default value: `false`
     289 + 
     290 +Set this option to generate your own gradients.
     291 +Each color set in the gradient option will then be transitioned to directly.
     292 +This option allows you to specify more than just two colors for your gradient.
     293 +Only works in combination with the [gradient](#-g---gradient) option.
     294 + 
     295 +```shell
     296 +$ cfonts "text" --gradient red,"#f80",green,blue --transition-gradient
     297 +```
     298 + 
     299 +![Independent gradient command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/transition-gradient.png)
     300 + 
     301 + 
    284 302  #### -b, --background
    285 303  Type: `<string>`
    286 304  Default value: `"transparent"`
    skipped 91 lines
    378 396   
    379 397  ## Contributing
    380 398  To build the repo install dependencies via:
     399 +_(Since we ship a `yarn.lock` file please use [`yarn`](https://yarnpkg.com/) for development.)_
    381 400   
    382 401  ```shell
    383 402  yarn
    skipped 2 lines
    386 405  and run the watch to continuously transpile the code.
    387 406   
    388 407  ```shell
    389  -npm run watch
     408 +yarn watch
    390 409  ```
    391 410   
    392 411  Please look at the coding style and work with it, not against it ;)
    393 412   
    394 413   
    395  -## Test
    396  -The package comes with a bunch of [unit tests](https://github.com/dominikwilkowski/cfonts/tree/master/test/unit) and a
    397  -[test suite](https://github.com/dominikwilkowski/cfonts/blob/master/test/fonttest.js) for font files.
     414 +## Tests
     415 +This package is tested on the below platform and node combinations as part of our [CI](https://github.com/dominikwilkowski/cfonts/tree/master/.travis.yml).
    398 416   
    399  -Run the unit tests via:
     417 +| Platform | Node |
     418 +|----------|--------|
     419 +| Linux | v10 |
     420 +| Linux | v12 |
     421 +| Linux | latest |
     422 +| OSX | v10 |
     423 +| OSX | v12 |
     424 +| OSX | latest |
     425 +| Windows | v10 |
     426 +| Windows | v12 |
     427 +| Windows | latest |
     428 + 
     429 +### Unit tests
     430 +The package comes with a bunch of [unit tests](https://github.com/dominikwilkowski/cfonts/tree/master/test/unit) that aim to cover 100% of the code base.
     431 +For more details about the code coverage check out [coveralls](https://coveralls.io/github/dominikwilkowski/cfonts?branch=master).
    400 432   
    401 433  ```shell
    402 434  npm run test:unit
    403 435  ```
    404 436   
    405  -Run the font test suite via:
     437 +### Type tests
     438 +Since the code base uses [JSDocs](https://jsdoc.app/) we use [typescript](https://www.typescriptlang.org/) to test the inferred types from those comments.
     439 +Typescript [supports JSDocs](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc) and we use it in our
     440 +[test](https://github.com/dominikwilkowski/cfonts/blob/master/package.json#L38).
     441 + 
     442 +```shell
     443 +npm run test:types
     444 +```
     445 + 
     446 +### Font file test
     447 +There is also a [test suite](https://github.com/dominikwilkowski/cfonts/blob/master/test/fonttest.js) for font files.
    406 448   
    407 449  ```shell
    408 450  npm run test:fonts
    skipped 7 lines
    416 458   - consistent width
    417 459   - consistent lines
    418 460   
    419  -Or run all tests via:
     461 +### All tests
     462 +Run all tests via:
    420 463   
    421 464  ```shell
    422 465  npm run test
    skipped 1 lines
    424 467   
    425 468   
    426 469  ## Release History
     470 +* 2.6.0 - added transition gradients and sets
    427 471  * 2.5.2 - fixed jsDocs, added typescript type test
    428 472  * 2.5.1 - fixed array output to include everything including colors
    429 473  * 2.5.0 - added gradient option, separated code into files, added 100% unit testing coverage
    skipped 47 lines
  • img/transition-gradient.png
  • ■ ■ ■ ■
    package.json
    1 1  {
    2 2   "name": "cfonts",
    3 3   "description": "Sexy fonts for the console",
    4  - "version": "2.5.2",
     4 + "version": "2.6.0",
    5 5   "homepage": "https://github.com/dominikwilkowski/cfonts",
    6 6   "author": {
    7 7   "name": "Dominik Wilkowski",
    skipped 100 lines
  • ■ ■ ■ ■ ■ ■
    src/CheckInput.js
    skipped 20 lines
    21 21   COLORS,
    22 22   BGCOLORS,
    23 23   GRADIENTCOLORS,
     24 + GRADIENTS,
    24 25   ALIGNMENT,
    25 26   FONTFACES,
    26 27   HEXTEST,
    skipped 3 lines
    30 31  /**
    31 32   * Check input for human errors
    32 33   *
    33  - * @param {string} INPUT - The string you want to write out
    34  - * @param {string} userFont - The user specified font
    35  - * @param {array} userColors - The user specified colors
    36  - * @param {string} userBackground - The user specified background color
    37  - * @param {string} userAlign - The user specified alignment option
    38  - * @param {array} userGradient - The user specified gradient option
    39  - * @param {object} fontfaces - All allowed fontfaces
    40  - * @param {object} colors - All allowed font colors
    41  - * @param {object} bgcolors - All allowed background colors
    42  - * @param {array} alignment - All allowed alignments
     34 + * @param {string} INPUT - The string you want to write out
     35 + * @param {string} userFont - The user specified font
     36 + * @param {array} userColors - The user specified colors
     37 + * @param {string} userBackground - The user specified background color
     38 + * @param {string} userAlign - The user specified alignment option
     39 + * @param {array} userGradient - The user specified gradient option
     40 + * @param {boolean} userTransitionGradient - The user specified gradient transition option
     41 + * @param {object} fontfaces - All allowed fontfaces
     42 + * @param {object} colors - All allowed font colors
     43 + * @param {object} bgcolors - All allowed background colors
     44 + * @param {object} gradientcolors - All allowed gradient colors
     45 + * @param {object} gradients - All allowed gradients
     46 + * @param {array} alignment - All allowed alignments
    43 47   *
    44 48   * @typedef {object} ReturnObject
    45  - * @property {boolean} pass - Whether the input is valid
    46  - * @property {string} message - Possible error messages
     49 + * @property {boolean} pass - Whether the input is valid
     50 + * @property {string} message - Possible error messages
    47 51   *
    48  - * @return {ReturnObject} - An object with error messages and a pass key
     52 + * @return {ReturnObject} - An object with error messages and a pass key
    49 53   */
    50 54  const CheckInput = (
    51 55   INPUT,
    skipped 2 lines
    54 58   userBackground,
    55 59   userAlign,
    56 60   userGradient,
     61 + userTransitionGradient,
    57 62   fontfaces = FONTFACES,
    58 63   colors = COLORS,
    59 64   bgcolors = BGCOLORS,
    60 65   gradientcolors = GRADIENTCOLORS,
     66 + gradients = GRADIENTS,
    61 67   alignment = ALIGNMENT
    62 68  ) => {
    63 69   let result = {
    skipped 61 lines
    125 131   
    126 132   // CHECKING GRADIENT
    127 133   if( userGradient ) {
    128  - if( userGradient.length !== 2 ) {
    129  - return {
    130  - message: `"${ Chalk.red( userGradient ) }" is not a valid gradient option.\n` +
    131  - `Please pass in two colors.`,
    132  - pass: false,
    133  - };
     134 + if(
     135 + userGradient.length === 1
     136 + && Object.keys( gradients ).indexOf( userGradient[ 0 ].toLowerCase() ) !== -1
     137 + && userTransitionGradient
     138 + ) {
     139 + return result;
    134 140   }
     141 + else {
     142 + if( userGradient.length < 2 ) {
     143 + return {
     144 + message: `"${ Chalk.red( userGradient ) }" is not a valid gradient option.\n` +
     145 + `Please pass in${ userTransitionGradient ? ' at least' : '' } two colors.`,
     146 + pass: false,
     147 + };
     148 + }
    135 149   
    136  - // check validity of colors
    137  - userGradient.forEach( color => {
    138  - if(
    139  - Object.keys( gradientcolors ).indexOf( color.toLowerCase() ) === -1
    140  - && !HEXTEST.test( color )
    141  - ) {
    142  - result = {
    143  - message: `"${ Chalk.red( color ) }" is not a valid gradient color option.\n` +
    144  - `Please use a color from the supported stack or any valid hex color:\n${ Chalk.green(`${
    145  - Object.keys( gradientcolors ).map( color => colors[ color ] ).join(', ')
    146  - }, "#3456ff", "#f80", etc...`) }`,
     150 + if( userGradient.length !== 2 && !userTransitionGradient ) {
     151 + return {
     152 + message: `"${ Chalk.red( userGradient ) }" is not a valid gradient option.\n` +
     153 + `Please pass in two colors.`,
    147 154   pass: false,
    148 155   };
    149 156   }
    150  - });
     157 + 
     158 + // check validity of colors
     159 + userGradient.forEach( color => {
     160 + if(
     161 + Object.keys( gradientcolors ).indexOf( color.toLowerCase() ) === -1
     162 + && !HEXTEST.test( color )
     163 + ) {
     164 + result = {
     165 + message: `"${ Chalk.red( color ) }" is not a valid gradient color option.\n` +
     166 + `Please use a color from the supported stack or any valid hex color:\n${ Chalk.green(`${
     167 + Object.keys( gradientcolors ).map( color => colors[ color ] ).join(', ')
     168 + }, "#3456ff", "#f80", etc...`) }`,
     169 + pass: false,
     170 + };
     171 + }
     172 + });
     173 + }
    151 174   }
    152 175   
    153 176   return result;
    skipped 7 lines
  • ■ ■ ■ ■ ■
    src/GetOptions.js
    skipped 41 lines
    42 42   * @property {number} maxLength - Maximum amount of characters per line, Default width of console window
    43 43   * @property {(string|array)} gradient - Gradient color pair, Default: false
    44 44   * @property {boolean} independentGradient - A switch to calculate gradient per line or not
     45 + * @property {boolean} transitionGradient - A switch for transition gradients
    45 46   *
    46 47   * @return {object} - Our merged options
    47 48   */
    48 49  const GetOptions = (
    49  - { font, align, colors, background, backgroundColor, letterSpacing, lineHeight, space, maxLength, gradient, independentGradient },
     50 + { font, align, colors, background, backgroundColor, letterSpacing, lineHeight, space, maxLength, gradient, independentGradient, transitionGradient },
    50 51   allowedColors = COLORS,
    51 52   allowedBG = BGCOLORS,
    52 53   allowedFont = FONTFACES
    skipped 28 lines
    81 82   : gradient.split(',')
    82 83   : false,
    83 84   independentGradient: independentGradient || false,
     85 + transitionGradient: transitionGradient || false,
    84 86  });
    85 87   
    86 88   
    skipped 4 lines
  • ■ ■ ■ ■ ■ ■
    src/Gradient.js
    skipped 17 lines
    18 18   
    19 19  const { GetFirstCharacterPosition } = require('./GetFirstCharacterPosition.js');
    20 20  const { GetLongestLine } = require('./GetLongestLine.js');
     21 +const { GRADIENTS } = require('./constants.js');
    21 22  const { Debugging } = require('./Debugging.js');
    22 23  const { Color } = require('./Color.js');
    23 24   
    skipped 105 lines
    129 130   *
    130 131   * @param {string} hex - The HEX color
    131 132   *
    132  - * @return {object} - An object with RGB values
     133 + * @return {array} - An object with RGB values
    133 134   */
    134 135  function Hex2rgb( hex ) {
    135 136   hex = hex.replace(/^#/, '');
    skipped 227 lines
    363 364   
    364 365   
    365 366  /**
     367 + * Calculate the gaps between an array of points
     368 + *
     369 + * @param {array} points - An array of points, it's not important what's in the array for this function
     370 + * @param {number} steps - The amount of steps we have to distribute between the above points
     371 + *
     372 + * @return {array} - An array of steps per gap
     373 + */
     374 +function GetGaps( points, steps ) {
     375 + // steps per gap
     376 + const gapSteps = Math.floor( ( steps - points.length ) / ( points.length - 1 ) );
     377 + // steps left over to be distributed
     378 + const rest = steps - ( points.length + gapSteps * ( points.length - 1 ) );
     379 + // the gaps array has one less items than our points (cause it's gaps between each of the points)
     380 + const gaps = Array( points.length - 1 ).fill( gapSteps );
     381 + 
     382 + // let's fill in the rest from the right
     383 + for( let i = 0; i < rest; i++ ) {
     384 + gaps[ gaps.length - 1 - i ] ++;
     385 + }
     386 + 
     387 + return gaps;
     388 +}
     389 + 
     390 +/**
     391 + * Generate colors between two given colors
     392 + *
     393 + * @param {string} fromHex - The color we start from in hex
     394 + * @param {string} toHex - The color we end up at in hex
     395 + * @param {number} steps - How many colors should be returned
     396 + *
     397 + * @return {array} - An array for colors
     398 + */
     399 +function TransitionBetweenHex( fromHex, toHex, steps ) {
     400 + const fromRgb = Hex2rgb( fromHex );
     401 + const toRgb = Hex2rgb( toHex );
     402 + const hexColors = [];
     403 + steps ++;
     404 + 
     405 + for( let n = 1; n < steps; n++ ) {
     406 + const red = GetLinear( fromRgb[ 0 ], toRgb[ 0 ], n, steps );
     407 + const green = GetLinear( fromRgb[ 1 ], toRgb[ 1 ], n, steps );
     408 + const blue = GetLinear( fromRgb[ 2 ], toRgb[ 2 ], n, steps );
     409 + 
     410 + hexColors.push( Rgb2hex( red, green, blue ) );
     411 + }
     412 + 
     413 + return hexColors;
     414 +}
     415 + 
     416 +/**
     417 + * Generate n colors between x colors
     418 + *
     419 + * @param {array} colors - An array of colors in hex
     420 + * @param {number} steps - The amount of colors to generate
     421 + * @param {object} gradients - An object of pre-packaged gradient colors
     422 + *
     423 + * @return {array} - An array of colors
     424 + */
     425 +function Transition( colors, steps, gradients = GRADIENTS ) {
     426 + let hexColors = [];
     427 + if( colors.length === 1 ) {
     428 + colors = gradients[ colors[ 0 ].toLowerCase() ];
     429 + }
     430 + else {
     431 + colors = colors.map( color => Color2hex( color ) );
     432 + }
     433 + const gaps = GetGaps( colors, steps );
     434 + 
     435 + if( steps <= 1 ) {
     436 + return [ colors[ colors.length - 1 ] ];
     437 + }
     438 + 
     439 + for( let i = 0; i < colors.length; i++ ) {
     440 + const gap = gaps[ i - 1 ];
     441 + 
     442 + if( colors[ i - 1 ] ) {
     443 + const gapColors = TransitionBetweenHex( colors[ i - 1 ], colors[ i ], gap );
     444 + hexColors = [ ...hexColors, ...gapColors ];
     445 + }
     446 + 
     447 + if( gap !== -1 ) {
     448 + hexColors.push( colors[ i ] );
     449 + }
     450 + }
     451 + 
     452 + return hexColors;
     453 +}
     454 + 
     455 + 
     456 +/**
    366 457   * Paint finished output in a gradient
    367 458   *
    368 459   * @param {object} options - Arguments
    skipped 3 lines
    372 463   * @param {number} options.lineHeight - The line height between lines
    373 464   * @param {number} options.fontLines - The line height (line breaks) of a single font line
    374 465   * @param {boolean} options.independentGradient - A switch to calculate gradient per line or not
     466 + * @param {boolean} options.transitionGradient - A switch for transition gradients
    375 467   *
    376 468   * @return {array} - The output array painted in ANSI colors
    377 469   */
    378  -function PaintGradient({ output, gradient, lines, lineHeight, fontLines, independentGradient }) {
     470 +function PaintGradient({ output, gradient, lines, lineHeight, fontLines, independentGradient, transitionGradient }) {
    379 471   Debugging.report(`Running PaintGradient`, 1);
    380  - const gradientStart = Color2hex( gradient[ 0 ] );
    381  - const gradientEnd = Color2hex( gradient[ 1 ] );
    382 472   let newOutput = [];
    383 473   
    384  - Debugging.report(`Gradient start: ${ gradientStart } | Gradient end: ${ gradientEnd }`, 2);
     474 + if( transitionGradient ) {
     475 + Debugging.report(`Gradient transition with colors: ${ JSON.stringify( gradient ) }`, 2);
     476 + }
     477 + else {
     478 + Debugging.report(`Gradient start: ${ gradient[ 0 ] } | Gradient end: ${ gradient[ 1 ] }`, 2);
     479 + }
    385 480   
    386 481   let firstCharacterPosition;
    387 482   let longestLine;
    skipped 20 lines
    408 503   
    409 504   Debugging.report(`longestLine: ${ longestLine } | firstCharacterPosition: ${ firstCharacterPosition }`, 2);
    410 505   
    411  - const colors = GetGradientColors( gradientStart, gradientEnd, colorsNeeded );
     506 + const colors = transitionGradient
     507 + ? Transition( gradient, colorsNeeded )
     508 + : GetGradientColors( Color2hex( gradient[ 0 ] ), Color2hex( gradient[ 1 ] ), colorsNeeded );
     509 + 
    412 510   newOutput = [ ...newOutput, ...linesInbetween, ...PaintLines( thisLine, colors, firstCharacterPosition ) ];
    413 511   }
    414 512   
    skipped 15 lines
    430 528   GetGradientColors,
    431 529   PaintLines,
    432 530   Color2hex,
     531 + GetGaps,
     532 + TransitionBetweenHex,
     533 + Transition,
    433 534   PaintGradient,
    434 535  };
    435 536   
  • ■ ■ ■ ■ ■
    src/Render.js
    skipped 65 lines
    66 66   let lines = 0; // for counting each line
    67 67   let FONTFACE = {}; // scoping the fontface object higher for fonts with just one color
    68 68   
    69  - const _isGoodHuman = CheckInput( INPUT, OPTIONS.font, OPTIONS.colors, OPTIONS.background, OPTIONS.align, OPTIONS.gradient );
     69 + const _isGoodHuman = CheckInput( INPUT, OPTIONS.font, OPTIONS.colors, OPTIONS.background, OPTIONS.align, OPTIONS.gradient, OPTIONS.transitionGradient );
    70 70   if( !_isGoodHuman.pass ) {
    71 71   Log.error( _isGoodHuman.message );
    72 72   
    skipped 125 lines
    198 198   lineHeight: OPTIONS.lineHeight,
    199 199   fontLines: FONTFACE.lines,
    200 200   independentGradient: OPTIONS.independentGradient,
     201 + transitionGradient: OPTIONS.transitionGradient,
    201 202   });
    202 203   }
    203 204   
    skipped 27 lines
  • ■ ■ ■ ■ ■ ■
    src/constants.js
    skipped 85 lines
    86 86   white: 'white',
    87 87  };
    88 88   
     89 +const GRADIENTS = {
     90 + lgbt: [ '#750787', '#004dff', '#008026', '#ffed00', '#ff8c00', '#e40303' ],
     91 + lgbtq: [ '#750787', '#004dff', '#008026', '#ffed00', '#ff8c00', '#e40303' ],
     92 + pride: [ '#750787', '#004dff', '#008026', '#ffed00', '#ff8c00', '#e40303' ],
     93 + agender: [ '#000000', '#b9b9b9', '#ffffff', '#b8f483', '#ffffff', '#b9b9b9', '#000000' ],
     94 + aromantic: [ '#3da542', '#a7d379', '#ffffff', '#a9a9a9', '#000000' ],
     95 + asexual: [ '#000000', '#a3a3a3', '#ffffff', '#800080' ],
     96 + bisexual: [ '#d60270', '#d60270', '#9b4f96', '#0038a8', '#0038a8' ],
     97 + genderfluid: [ '#ff75a2', '#ffffff', '#be18d6', '#000000', '#333ebd' ],
     98 + genderqueer: [ '#b57edc', '#ffffff', '#4a8123' ],
     99 + intersex: [ '#ffd800', '#ffd800', '#7902aa', '#ffd800', '#ffd800' ],
     100 + lesbian: [ '#d52d00', '#ff9a56', '#ffffff', '#d362a4', '#a30262' ],
     101 + nonbinary: [ '#fcf434', '#ffffff', '#9c5cd4', '#2c2c2c' ],
     102 + pansexual: [ '#ff218c', '#ffd800', '#21b1ff' ],
     103 + polysexual: [ '#f61cb9', '#07d569', '#1c92f6' ],
     104 + transgender: [ '#5bcefa', '#f5a9b8', '#ffffff', '#f5a9b8', '#5bcefa' ],
     105 +};
     106 + 
    89 107  const ALIGNMENT = [
    90 108   'left',
    91 109   'center',
    skipped 88 lines
    180 198   default: false,
    181 199   },
    182 200   '--independent-gradient': {
    183  - description: 'Use to define if a gradient is applied independently for each line',
     201 + description: 'Use to define that a gradient is applied independently for each line',
    184 202   example: '--gradient red,blue --independent-gradient',
    185 203   short: '-i',
     204 + default: false,
     205 + },
     206 + '--transition-gradient': {
     207 + description: 'Use to define that a gradient is a transition between the colors',
     208 + example: '--gradient red,blue,green --transition-gradient',
     209 + short: '-t',
    186 210   default: false,
    187 211   },
    188 212   '--debug': {
    skipped 21 lines
    210 234   COLORS,
    211 235   BGCOLORS,
    212 236   GRADIENTCOLORS,
     237 + GRADIENTS,
    213 238   ALIGNMENT,
    214 239   FONTFACES,
    215 240   CLIOPTIONS,
    skipped 4 lines
  • ■ ■ ■ ■ ■
    src/index.js
    skipped 81 lines
    82 82   maxLength: args['max-length'],
    83 83   gradient: args.gradient,
    84 84   independentGradient: args['independent-gradient'],
     85 + transitionGradient: args['transition-gradient'],
    85 86   }, args.debug, args.debugLevel );
    86 87  };
    87 88   
    skipped 7 lines
  • ■ ■ ■ ■ ■ ■
    test/unit/CheckInput.spec.js
    skipped 12 lines
    13 13   const COLORS = { color1: 'color1', color2: 'color2', color3: 'color3' };
    14 14   const BGCOLORS = { bgcolor1: 'bgcolor1', bgcolor2: 'bgcolor2', bgcolor3: 'bgcolor3' };
    15 15   const ALIGNMENT = [ 'left', 'center', 'right' ];
     16 + const GRADIENTS = {
     17 + 'set1': ['color1', 'color2'],
     18 + 'set2': ['color1', 'color2'],
     19 + 'set3': ['color1', 'color2'],
     20 + };
    16 21   
    17  - expect( CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    18  - expect( CheckInput( 'INPUT', 'font2', ['color2', 'candy'], 'bgcolor2', 'center', false, FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    19  - expect( CheckInput( 'INPUT', 'font3', ['color3'], 'bgcolor3', 'right', ['#ff8800','color3'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    20  - expect( CheckInput( 'INPUT', 'font3', ['candy'], 'bgcolor3', 'right', ['color1','#ff8800'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
     22 + expect( CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     23 + expect( CheckInput( 'INPUT', 'font2', ['color2', 'candy'], 'bgcolor2', 'center', false, false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     24 + expect( CheckInput( 'INPUT', 'font3', ['color3'], 'bgcolor3', 'right', ['#ff8800','color3'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     25 + expect( CheckInput( 'INPUT', 'font3', ['candy'], 'bgcolor3', 'right', ['color1','#ff8800'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     26 + expect( CheckInput( 'INPUT', 'font3', ['color1'], 'bgcolor2', 'right', ['color1','#ff8800', 'color1', 'color2', 'color3'], true, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     27 + expect( CheckInput( 'INPUT', 'font3', ['color1'], 'bgcolor2', 'right', ['set1'], true, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
    21 28  });
    22 29   
    23 30   
    skipped 2 lines
    26 33   const COLORS = { color1: 'coLOr1', color2: 'coLOr2', color3: 'cOLor3' };
    27 34   const BGCOLORS = { bgcolor1: 'bGCOlor1', bgcolor2: 'bGCOlor2', bgcolor3: 'bGCOlor3' };
    28 35   const ALIGNMENT = [ 'left', 'center', 'right' ];
     36 + const GRADIENTS = {
     37 + 'set1': ['color1', 'color2'],
     38 + 'set2': ['color1', 'color2'],
     39 + 'set3': ['color1', 'color2'],
     40 + };
    29 41   
    30  - expect( CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    31  - expect( CheckInput( 'INPUT', 'font2', ['color2', 'candy'], 'bgcolor2', 'center', false, FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    32  - expect( CheckInput( 'INPUT', 'font3', ['color3'], 'bgcolor3', 'right', ['#ff8800','color3'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
    33  - expect( CheckInput( 'INPUT', 'font3', ['candy'], 'bgcolor3', 'right', ['color1','#ff8800'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT ).pass ).toEqual( true );
     42 + expect( CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     43 + expect( CheckInput( 'INPUT', 'font2', ['color2', 'candy'], 'bgcolor2', 'center', false, false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     44 + expect( CheckInput( 'INPUT', 'font3', ['color3'], 'bgcolor3', 'right', ['#ff8800','color3'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     45 + expect( CheckInput( 'INPUT', 'font3', ['candy'], 'bgcolor3', 'right', ['color1','#ff8800'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
     46 + expect( CheckInput( 'INPUT', 'font3', ['candy'], 'bgcolor3', 'right', ['sEt2'], true, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT ).pass ).toEqual( true );
    34 47  });
    35 48   
    36 49   
    skipped 2 lines
    39 52   const COLORS = { color1: 'color1', color2: 'color2', color3: 'color3' };
    40 53   const BGCOLORS = { bgcolor1: 'bgcolor1', bgcolor2: 'bgcolor2', bgcolor3: 'bgcolor3' };
    41 54   const ALIGNMENT = [ 'left', 'center', 'right' ];
     55 + const GRADIENTS = {
     56 + 'set1': ['color1', 'color2'],
     57 + 'set2': ['color1', 'color2'],
     58 + 'set3': ['color1', 'color2'],
     59 + };
    42 60   
    43  - const fail = CheckInput( undefined, 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     61 + const fail = CheckInput( undefined, 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    44 62   expect( fail.pass ).toEqual( false );
    45 63   expect( fail.message.length > 0 ).toEqual( true );
    46 64   
    47  - const fail0 = CheckInput( '', 'font1', ['color1'], 'bgcolor1', 'left', false, FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     65 + const fail0 = CheckInput( '', 'font1', ['color1'], 'bgcolor1', 'left', false, false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    48 66   expect( fail0.pass ).toEqual( false );
    49 67   expect( fail0.message.length > 0 ).toEqual( true );
    50 68   
    51  - const fail1 = CheckInput( 'INPUT', 'notfound', ['color1'], 'bgcolor1', 'left', ['#ff8800','color3'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     69 + const fail1 = CheckInput( 'INPUT', 'notfound', ['color1'], 'bgcolor1', 'left', ['#ff8800','color3'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    52 70   expect( fail1.pass ).toEqual( false );
    53 71   expect( fail1.message.length > 0 ).toEqual( true );
    54 72   
    55  - const fail2 = CheckInput( 'INPUT', 'font1', ['notfound'], 'bgcolor1', 'left', ['color1','#ff8800'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     73 + const fail2 = CheckInput( 'INPUT', 'font1', ['notfound'], 'bgcolor1', 'left', ['color1','#ff8800'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    56 74   expect( fail2.pass ).toEqual( false );
    57 75   expect( fail2.message.length > 0 ).toEqual( true );
    58 76   
    59  - const fail3 = CheckInput( 'INPUT', 'font1', ['color1'], 'notfound', 'left', false, FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     77 + const fail3 = CheckInput( 'INPUT', 'font1', ['color1'], 'notfound', 'left', false, false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    60 78   expect( fail3.pass ).toEqual( false );
    61 79   expect( fail3.message.length > 0 ).toEqual( true );
    62 80   
    63  - const fail4 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'notfound', false, FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     81 + const fail4 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'notfound', false, false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    64 82   expect( fail4.pass ).toEqual( false );
    65 83   expect( fail4.message.length > 0 ).toEqual( true );
    66 84   
    67  - const fail5 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     85 + const fail5 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    68 86   expect( fail5.pass ).toEqual( false );
    69 87   expect( fail5.message.length > 0 ).toEqual( true );
    70 88   
    71  - const fail6 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['notfound','color1'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     89 + const fail6 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['notfound','color1'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    72 90   expect( fail6.pass ).toEqual( false );
    73 91   expect( fail6.message.length > 0 ).toEqual( true );
    74 92   
    75  - const fail7 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color2','#egz'], FONTFACES, COLORS, BGCOLORS, COLORS, ALIGNMENT );
     93 + const fail7 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color2','#egz'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
    76 94   expect( fail7.pass ).toEqual( false );
    77 95   expect( fail7.message.length > 0 ).toEqual( true );
     96 + 
     97 + const fail8 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1','color2','color3'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
     98 + expect( fail8.pass ).toEqual( false );
     99 + expect( fail8.message.length > 0 ).toEqual( true );
     100 + 
     101 + const fail9 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['color1'], true, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
     102 + expect( fail9.pass ).toEqual( false );
     103 + expect( fail9.message.length > 0 ).toEqual( true );
     104 + 
     105 + const fail10 = CheckInput( 'INPUT', 'font1', ['color1'], 'bgcolor1', 'left', ['set2'], false, FONTFACES, COLORS, BGCOLORS, COLORS, GRADIENTS, ALIGNMENT );
     106 + expect( fail10.pass ).toEqual( false );
     107 + expect( fail10.message.length > 0 ).toEqual( true );
    78 108  });
    79 109   
  • ■ ■ ■ ■ ■ ■
    test/unit/GetOptions.spec.js
    skipped 19 lines
    20 20   maxLength: 0,
    21 21   gradient: false,
    22 22   independentGradient: false,
     23 + transitionGradient: false,
    23 24   });
    24 25  });
    25 26   
    skipped 23 lines
    49 50   maxLength: 0,
    50 51   gradient: false,
    51 52   independentGradient: false,
     53 + transitionGradient: false,
    52 54   });
    53 55  });
    54 56   
    skipped 21 lines
    76 78   maxLength: 0,
    77 79   gradient: false,
    78 80   independentGradient: false,
     81 + transitionGradient: false,
    79 82   });
    80 83  });
    81 84   
    skipped 10 lines
    92 95   maxLength: 0,
    93 96   gradient: false,
    94 97   independentGradient: false,
     98 + transitionGradient: false,
    95 99   });
    96 100   
    97 101   expect( GetOptions({ align: 'xxx' }) ).toEqual({
    skipped 7 lines
    105 109   maxLength: 0,
    106 110   gradient: false,
    107 111   independentGradient: false,
     112 + transitionGradient: false,
    108 113   });
    109 114   
    110 115   expect( GetOptions({ colors: ['xxx'] }) ).toEqual({
    skipped 7 lines
    118 123   maxLength: 0,
    119 124   gradient: false,
    120 125   independentGradient: false,
     126 + transitionGradient: false,
    121 127   });
    122 128   
    123 129   expect( GetOptions({ background: 'xxx' }) ).toEqual({
    skipped 7 lines
    131 137   maxLength: 0,
    132 138   gradient: false,
    133 139   independentGradient: false,
     140 + transitionGradient: false,
    134 141   });
    135 142   
    136 143   expect( GetOptions({ backgroundColor: 'xxx' }) ).toEqual({
    skipped 7 lines
    144 151   maxLength: 0,
    145 152   gradient: false,
    146 153   independentGradient: false,
     154 + transitionGradient: false,
    147 155   });
    148 156   
    149 157   expect( GetOptions({ letterSpacing: 555 }) ).toEqual({
    skipped 7 lines
    157 165   maxLength: 0,
    158 166   gradient: false,
    159 167   independentGradient: false,
     168 + transitionGradient: false,
    160 169   });
    161 170   
    162 171   expect( GetOptions({ lineHeight: 555 }) ).toEqual({
    skipped 7 lines
    170 179   maxLength: 0,
    171 180   gradient: false,
    172 181   independentGradient: false,
     182 + transitionGradient: false,
    173 183   });
    174 184   
    175 185   expect( GetOptions({ space: false }) ).toEqual({
    skipped 7 lines
    183 193   maxLength: 0,
    184 194   gradient: false,
    185 195   independentGradient: false,
     196 + transitionGradient: false,
    186 197   });
    187 198   
    188 199   expect( GetOptions({ maxLength: 555 }) ).toEqual({
    skipped 7 lines
    196 207   maxLength: 555,
    197 208   gradient: false,
    198 209   independentGradient: false,
     210 + transitionGradient: false,
    199 211   });
    200 212   
    201 213   expect( GetOptions({ gradient: 'red,green' }) ).toEqual({
    skipped 7 lines
    209 221   maxLength: 0,
    210 222   gradient: ['red', 'green'],
    211 223   independentGradient: false,
     224 + transitionGradient: false,
    212 225   });
    213 226   
    214 227   expect( GetOptions({ gradient: ['red','green'] }) ).toEqual({
    skipped 7 lines
    222 235   maxLength: 0,
    223 236   gradient: ['red', 'green'],
    224 237   independentGradient: false,
     238 + transitionGradient: false,
    225 239   });
    226 240   
    227 241   expect( GetOptions({ independentGradient: true }) ).toEqual({
    skipped 7 lines
    235 249   maxLength: 0,
    236 250   gradient: false,
    237 251   independentGradient: true,
     252 + transitionGradient: false,
     253 + });
     254 + 
     255 + expect( GetOptions({ transitionGradient: true }) ).toEqual({
     256 + font: 'block',
     257 + align: 'left',
     258 + colors: [],
     259 + background: 'transparent',
     260 + letterSpacing: 1,
     261 + lineHeight: 1,
     262 + space: true,
     263 + maxLength: 0,
     264 + gradient: false,
     265 + independentGradient: false,
     266 + transitionGradient: true,
    238 267   });
    239 268  });
    240 269   
  • ■ ■ ■ ■ ■ ■
    test/unit/Gradient.spec.js
    skipped 18 lines
    19 19   GetGradientColors,
    20 20   PaintLines,
    21 21   Color2hex,
     22 + GetGaps,
     23 + TransitionBetweenHex,
     24 + Transition,
    22 25   PaintGradient,
    23 26  } = require('../../src/Gradient.js');
    24 27   
    skipped 202 lines
    227 230   expect( Color2hex('#ff0000') ).toEqual('#ff0000');
    228 231  });
    229 232   
     233 +test(`Gradient - GetGaps - Should give us the correct gaps`, () => {
     234 + expect( GetGaps( [ 1 ], 1 ) ).toEqual( [] );
     235 + expect( GetGaps( [ 1, 1 ], 1 ) ).toEqual( [ -1 ] );
     236 + expect( GetGaps( [ 1, 1 ], 2 ) ).toEqual( [ 0 ] );
     237 + expect( GetGaps( [ 1, 1 ], 3 ) ).toEqual( [ 1 ] );
     238 + expect( GetGaps( [ 1, 1 ], 4 ) ).toEqual( [ 2 ] );
     239 + expect( GetGaps( [ 1, 1 ], 5 ) ).toEqual( [ 3 ] );
     240 + 
     241 + expect( GetGaps( [ 1, 1, 1 ], 1 ) ).toEqual( [ -1, -1 ] );
     242 + expect( GetGaps( [ 1, 1, 1 ], 2 ) ).toEqual( [ -1, 0 ] );
     243 + expect( GetGaps( [ 1, 1, 1 ], 3 ) ).toEqual( [ 0, 0 ] );
     244 + expect( GetGaps( [ 1, 1, 1 ], 4 ) ).toEqual( [ 0, 1 ] );
     245 + expect( GetGaps( [ 1, 1, 1 ], 5 ) ).toEqual( [ 1, 1 ] );
     246 +});
     247 + 
     248 +test(`Gradient - TransitionBetweenHex - Should return colors between two`, () => {
     249 + expect( TransitionBetweenHex( '#ff0000', '#0000ff', -1 ) ).toEqual( [] );
     250 + expect( TransitionBetweenHex( '#ff0000', '#0000ff', 0 ) ).toEqual( [] );
     251 + expect( TransitionBetweenHex( '#ff0000', '#0000ff', 1 ) ).toEqual( [ '#7f007f' ] );
     252 + expect( TransitionBetweenHex( '#ff0000', '#0000ff', 2 ) ).toEqual( [ '#aa0055', '#5500aa' ] );
     253 + expect( TransitionBetweenHex( '#ff0000', '#0000ff', 5 ) ).toEqual( [ '#d4002a', '#aa0055', '#7f007f', '#5500aa', '#2a00d4' ] );
     254 +});
     255 + 
     256 +test(`Gradient - Transition - Should return colors between multiple`, () => {
     257 + expect( Transition( ['#ff0000', '#0000ff'], 1 ) ).toEqual( [ '#0000ff' ] );
     258 + expect( Transition( ['#ff0000', '#0000ff'], 2 ) ).toEqual( [ '#ff0000', '#0000ff' ] );
     259 + expect( Transition( ['#ff0000', '#0000ff'], 3 ) ).toEqual( [ '#ff0000', '#7f007f', '#0000ff' ] );
     260 + expect( Transition( ['#ff0000', '#0000ff'], 4 ) ).toEqual( [ '#ff0000', '#aa0055', '#5500aa', '#0000ff' ] );
     261 + 
     262 + expect( Transition( ['#ff0000', '#00ff00', '#0000ff'], 1 ) ).toEqual( [ '#0000ff' ] );
     263 + expect( Transition( ['#ff0000', '#00ff00', '#0000ff'], 2 ) ).toEqual( [ '#ff0000', '#0000ff' ] );
     264 + expect( Transition( ['#ff0000', '#00ff00', '#0000ff'], 3 ) ).toEqual( [ '#ff0000', '#00ff00', '#0000ff' ] );
     265 + expect( Transition( ['#ff0000', '#00ff00', '#0000ff'], 4 ) ).toEqual( [ '#ff0000', '#00ff00', '#007f7f', '#0000ff' ] );
     266 + expect( Transition( ['#ff0000', '#00ff00', '#0000ff'], 10 ) ).toEqual([
     267 + '#ff0000',
     268 + '#bf3f00',
     269 + '#7f7f00',
     270 + '#3fbf00',
     271 + '#00ff00',
     272 + '#00cc33',
     273 + '#009966',
     274 + '#006699',
     275 + '#0033cc',
     276 + '#0000ff',
     277 + ]);
     278 + 
     279 + expect( Transition( ['set2'], 2, { set2: [ '#ff0000', '#0000ff' ] } ) ).toEqual( [ '#ff0000', '#0000ff' ] );
     280 + expect( Transition( ['set2'], 4, { set2: [ '#ff0000', '#0000ff' ] } ) ).toEqual( [ '#ff0000', '#aa0055', '#5500aa', '#0000ff' ] );
     281 +});
     282 + 
    230 283  test(`Gradient - PaintGradient - Should paint multi-line output`, () => {
    231 284   const output1 = PaintGradient({
    232 285   output: ['x','xxx','xxx','x'],
    skipped 2 lines
    235 288   lineHeight: 0,
    236 289   fontLines: 1,
    237 290   independentGradient: false,
     291 + transitionGradient: false,
    238 292   });
    239 293   
    240 294   expect( output1 ).toEqual([
    skipped 10 lines
    251 305   lineHeight: 0,
    252 306   fontLines: 1,
    253 307   independentGradient: false,
     308 + transitionGradient: false,
    254 309   });
    255 310   
    256 311   expect( output2 ).toEqual([
    skipped 10 lines
    267 322   lineHeight: 0,
    268 323   fontLines: 1,
    269 324   independentGradient: true,
     325 + transitionGradient: false,
    270 326   });
    271 327   
    272 328   expect( output3 ).toEqual([
    skipped 4 lines
    277 333   ]);
    278 334  });
    279 335   
     336 +test(`Gradient - PaintGradient - Should paint multi-line output for transitions`, () => {
     337 + const output1 = PaintGradient({
     338 + output: ['x','xxx','xxx','x'],
     339 + gradient: ['red','blue'],
     340 + lines: 4,
     341 + lineHeight: 0,
     342 + fontLines: 1,
     343 + independentGradient: false,
     344 + transitionGradient: true,
     345 + });
     346 + 
     347 + expect( output1 ).toEqual([
     348 + '\u001b[38;2;255;0;0mx\u001b[39m',
     349 + '\u001b[38;2;255;0;0mx\u001b[39m\u001b[38;2;127;0;127mx\u001b[39m\u001b[38;2;0;0;255mx\u001b[39m',
     350 + '\u001b[38;2;255;0;0mx\u001b[39m\u001b[38;2;127;0;127mx\u001b[39m\u001b[38;2;0;0;255mx\u001b[39m',
     351 + '\u001b[38;2;255;0;0mx\u001b[39m',
     352 + ]);
     353 + 
     354 + const output2 = PaintGradient({
     355 + output: [' x','xxxxxxxx','xxx','x'],
     356 + gradient: ['pride'],
     357 + lines: 4,
     358 + lineHeight: 0,
     359 + fontLines: 1,
     360 + independentGradient: false,
     361 + transitionGradient: true,
     362 + });
     363 + 
     364 + expect( output2 ).toEqual([
     365 + '\u001b[38;2;117;7;135m \u001b[39m\u001b[38;2;0;77;255mx\u001b[39m',
     366 + '\u001b[38;2;117;7;135mx\u001b[39m\u001b[38;2;0;77;255mx\u001b[39m\u001b[38;2;0;128;38mx\u001b[39m\u001b[38;2;255;237;0mx\u001b[39m\u001b[38;2;255;188;0mx\u001b[39m\u001b[38;2;255;140;0mx\u001b[39m\u001b[38;2;241;71;1mx\u001b[39m\u001b[38;2;228;3;3mx\u001b[39m',
     367 + '\u001b[38;2;117;7;135mx\u001b[39m\u001b[38;2;0;77;255mx\u001b[39m\u001b[38;2;0;128;38mx\u001b[39m',
     368 + '\u001b[38;2;117;7;135mx\u001b[39m',
     369 + ]);
     370 +});
     371 + 
  • ■ ■ ■ ■ ■
    test/unit/ParseArgs.spec.js
    skipped 45 lines
    46 46   "font": "block",
    47 47   "gradient": false,
    48 48   "independent-gradient": false,
     49 + "transition-gradient": false,
    49 50   "help": false,
    50 51   "letter-spacing": 1,
    51 52   "line-height": 1,
    skipped 164 lines
  • ■ ■ ■ ■ ■ ■
    test/unit/Render.spec.js
    skipped 46 lines
    47 47   maxLength: 0,
    48 48   gradient: false,
    49 49   independentGradient: false,
     50 + transitionGradient: false,
    50 51   });
    51 52  });
    52 53   
    skipped 18 lines
    71 72   maxLength: 0,
    72 73   gradient: false,
    73 74   independentGradient: false,
     75 + transitionGradient: false,
    74 76   });
    75 77  });
    76 78   
    skipped 19 lines
    96 98   maxLength: 0,
    97 99   gradient: ['red','blue'],
    98 100   independentGradient: false,
     101 + transitionGradient: false,
    99 102   });
    100 103  });
    101 104   
    skipped 57 lines
    159 162   maxLength: 0,
    160 163   gradient: false,
    161 164   independentGradient: false,
     165 + transitionGradient: false,
    162 166   });
    163 167  });
    164 168   
    skipped 32 lines
    197 201   maxLength: 0,
    198 202   gradient: false,
    199 203   independentGradient: false,
     204 + transitionGradient: false,
    200 205   });
    201 206   
    202 207   
    skipped 30 lines
    233 238   maxLength: 0,
    234 239   gradient: false,
    235 240   independentGradient: false,
     241 + transitionGradient: false,
    236 242   });
    237 243  });
    238 244   
    skipped 32 lines
    271 277   maxLength: 0,
    272 278   gradient: false,
    273 279   independentGradient: false,
     280 + transitionGradient: false,
    274 281   });
    275 282  });
    276 283   
    skipped 32 lines
    309 316   maxLength: 0,
    310 317   gradient: false,
    311 318   independentGradient: false,
     319 + transitionGradient: false,
    312 320   });
    313 321  });
    314 322   
    skipped 43 lines
    358 366   maxLength: 0,
    359 367   gradient: false,
    360 368   independentGradient: false,
     369 + transitionGradient: false,
    361 370   });
    362 371  });
    363 372   
    skipped 43 lines
    407 416   maxLength: 0,
    408 417   gradient: false,
    409 418   independentGradient: false,
     419 + transitionGradient: false,
    410 420   });
    411 421  });
    412 422   
    skipped 44 lines
    457 467   maxLength: 0,
    458 468   gradient: false,
    459 469   independentGradient: false,
     470 + transitionGradient: false,
    460 471   });
    461 472  });
    462 473   
    skipped 30 lines
    493 504   maxLength: 0,
    494 505   gradient: false,
    495 506   independentGradient: false,
     507 + transitionGradient: false,
    496 508   });
    497 509  });
    498 510   
    skipped 29 lines
    528 540   maxLength: 0,
    529 541   gradient: false,
    530 542   independentGradient: false,
     543 + transitionGradient: false,
    531 544   });
    532 545  });
    533 546   
    skipped 32 lines
    566 579   maxLength: 0,
    567 580   gradient: false,
    568 581   independentGradient: false,
     582 + transitionGradient: false,
    569 583   });
    570 584  });
    571 585   
    skipped 9 lines
  • ■ ■ ■ ■ ■ ■
    test/unit/constants.spec.js
    skipped 9 lines
    10 10   COLORS,
    11 11   BGCOLORS,
    12 12   GRADIENTCOLORS,
     13 + GRADIENTS,
    13 14   ALIGNMENT,
    14 15   FONTFACES,
    15 16   CLIOPTIONS,
    skipped 18 lines
    34 35   
    35 36  test(`GRADIENTCOLORS - Should have n number of colors defined`, () => {
    36 37   expect( Object.keys( GRADIENTCOLORS ).length > 0 ).toEqual( true );
     38 +});
     39 + 
     40 + 
     41 +test(`GRADIENTS - Should have n number of colors defined`, () => {
     42 + expect( Object.keys( GRADIENTS ).length > 0 ).toEqual( true );
    37 43  });
    38 44   
    39 45   
    skipped 26 lines
Please wait...
Page is in error, reload to recover