LCOV - code coverage report
Current view: top level - src/lorem - lorem.js (source / functions) Hit Total Coverage
Test: cov_profile.lcov Lines: 26 27 96.3 %
Date: 2021-12-16 00:47:58 Functions: 4 4 100.0 %
Branches: 2 3 66.7 %

           Branch data     Line data    Source code
       1                 :          8 : export const lorem = (seeded, { qty = 15 } = {}) => {
       2            [ + ]:          0 :   const out = seeded.random() < 0.2 ? "lorem ipsum " : "";
       3            [ - ]:         30 :   let words = [];
       4                 :         30 :   while (words.length < qty) {
       5                 :         30 :     words = words.concat(
       6                 :         30 :       "dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum"
       7                 :         30 :         .split(
       8                 :         30 :           " ",
       9                 :         30 :         ),
      10                 :         30 :     );
      11                 :         30 :   }
      12                 :         30 :   return out + seeded.choose(qty, words).join(" ");
      13                 :          8 : };
      14                 :          8 : 
      15                 :          8 : export const word = (seeded) => seeded.lorem({ qty: 1 }).split(" ")[0];
      16                 :          8 : 
      17                 :          8 : export const sentence = (seeded) => {
      18                 :         18 :   const sentence = seeded.lorem({ qty: 25 });
      19                 :         18 :   return sentence[0].toUpperCase() + sentence.slice(1) + ".";
      20                 :          8 : };
      21                 :          8 : 
      22                 :          8 : // TODO: can I use Fiona.Array to generate paragraphs?
      23                 :          8 : export const paragraph = (seeded) =>
      24                 :         10 :   Array(seeded.number({ min: 1, max: 10 }))
      25                 :         10 :     .fill(0)
      26                 :         10 :     .map(() => seeded.sentence())
      27            [ + ]:          4 :     .join("  ");

Generated by: LCOV version 1.15