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-109.spec.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const { parse, inspect } = require('../../lib/index.cjs');
  2. const source = `
  3. /**
  4. * Typedef with multi-line property type.
  5. *
  6. * @typedef {object} MyType
  7. * @property {function(
  8. * number,
  9. * {x:string}
  10. * )} numberEater Method
  11. * which takes a number.
  12. */`;
  13. test('default', () => {
  14. const parsed = parse(source);
  15. // console.log(inspect(parsed[0]));
  16. expect(parsed[0].tags[1]).toMatchObject({
  17. tag: 'property',
  18. type: 'function(number,{x:string})',
  19. name: 'numberEater',
  20. description: 'Method which takes a number.',
  21. problems: [],
  22. });
  23. });
  24. test('preserve', () => {
  25. const parsed = parse(source, { spacing: 'preserve' });
  26. // console.log(inspect(parsed[0]));
  27. expect(parsed[0].tags[1]).toMatchObject({
  28. tag: 'property',
  29. type: 'function(\n number,\n {x:string}\n)',
  30. name: 'numberEater',
  31. description: 'Method\n which takes a number.',
  32. problems: [],
  33. });
  34. });
  35. test('compact', () => {
  36. const parsed = parse(source, { spacing: 'compact' });
  37. // console.log(inspect(parsed[0]));
  38. expect(parsed[0].tags[1]).toMatchObject({
  39. tag: 'property',
  40. type: 'function(number,{x:string})',
  41. name: 'numberEater',
  42. description: 'Method which takes a number.',
  43. problems: [],
  44. });
  45. });