Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue-121.spec.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. const { parse, inspect } = require('../../lib/index.cjs');
  2. test('name cut off', () => {
  3. const source = `
  4. /**
  5. * @param {{includeWhiteSpace: (boolean|undefined),
  6. * ignoreElementOrder: (boolean|undefined)}} [options] The options.
  7. */`.slice(1);
  8. const tagSource = [
  9. {
  10. number: 1,
  11. source: ' * @param {{includeWhiteSpace: (boolean|undefined),',
  12. tokens: {
  13. start: ' ',
  14. delimiter: '*',
  15. postDelimiter: ' ',
  16. tag: '@param',
  17. postTag: ' ',
  18. type: '{{includeWhiteSpace: (boolean|undefined),',
  19. postType: '',
  20. name: '',
  21. postName: '',
  22. description: '',
  23. end: '',
  24. lineEnd: '',
  25. },
  26. },
  27. {
  28. number: 2,
  29. source:
  30. ' * ignoreElementOrder: (boolean|undefined)}} [options] The options.',
  31. tokens: {
  32. start: ' ',
  33. delimiter: '*',
  34. postDelimiter: ' ',
  35. tag: '',
  36. postTag: '',
  37. type: ' ignoreElementOrder: (boolean|undefined)}}',
  38. postType: ' ',
  39. name: '[options]',
  40. postName: ' ',
  41. description: 'The options.',
  42. end: '',
  43. lineEnd: '',
  44. },
  45. },
  46. {
  47. number: 3,
  48. source: ' */',
  49. tokens: {
  50. start: ' ',
  51. delimiter: '',
  52. postDelimiter: '',
  53. tag: '',
  54. postTag: '',
  55. type: '',
  56. postType: '',
  57. name: '',
  58. postName: '',
  59. description: '',
  60. end: '*/',
  61. lineEnd: '',
  62. },
  63. },
  64. ];
  65. const parsed = parse(source);
  66. // console.log(inspect(parsed[0]));
  67. expect(parsed[0]).toMatchObject({
  68. problems: [],
  69. tags: [
  70. {
  71. tag: 'param',
  72. type: '{includeWhiteSpace: (boolean|undefined),ignoreElementOrder: (boolean|undefined)}',
  73. name: 'options',
  74. optional: true,
  75. description: 'The options.',
  76. source: tagSource,
  77. },
  78. ],
  79. source: [
  80. {
  81. number: 0,
  82. source: ' /**',
  83. tokens: {
  84. start: ' ',
  85. delimiter: '/**',
  86. postDelimiter: '',
  87. tag: '',
  88. postTag: '',
  89. type: '',
  90. postType: '',
  91. name: '',
  92. postName: '',
  93. description: '',
  94. end: '',
  95. lineEnd: '',
  96. },
  97. },
  98. ...tagSource,
  99. ],
  100. });
  101. });