jsfmt.spec.js.snap 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`arrow.js 1`] = `
  3. // Error
  4. const beep = (data/*: Object */) => {}
  5. // OK
  6. const beep = (data/*: Object */, secondData/*: Object */) => {}
  7. const beep = (data/*: /* this is an object *-/ Object */) => {};
  8. const run = (cmd /*: string */) /*: Promise<void> */ => {}
  9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. // Error
  11. const beep = (data /*: Object */) => {};
  12. // OK
  13. const beep = (data /*: Object */, secondData /*: Object */) => {};
  14. const beep = (data /*: /* this is an object *-/ Object */) => {};
  15. const run = (cmd /*: string */) /*: Promise<void> */ => {};
  16. `;
  17. exports[`class.js 1`] = `
  18. class A {
  19. x /*: string */;
  20. method(a /*: T */, b /*: T */) /*: T */ {}
  21. }
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. class A {
  24. x /*: string */;
  25. method(a /*: T */, b /*: T */) /*: T */ {}
  26. }
  27. `;
  28. exports[`functions.js 1`] = `
  29. function foo<T>(bar /*: T[] */, baz /*: T */) /*: S */ {}
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. function foo<T>(bar /*: T[] */, baz /*: T */) /*: S */ {}
  32. `;
  33. exports[`let.js 1`] = `
  34. let foo /*: Groups<T> */;
  35. let foo /*: string */ = 'a';
  36. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. let foo /*: Groups<T> */;
  38. let foo /*: string */ = "a";
  39. `;
  40. exports[`object_type_annotation.js 1`] = `
  41. type Props = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  42. {
  43. isPlaying: boolean,
  44. };
  45. type Props = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  46. isPlaying: boolean
  47. };
  48. type Props = {
  49. // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  50. isPlaying: boolean
  51. };
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  54. type Props = {
  55. isPlaying: boolean
  56. };
  57. type Props = {
  58. // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  59. isPlaying: boolean
  60. };
  61. type Props = {
  62. // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
  63. isPlaying: boolean
  64. };
  65. `;