jsfmt.spec.js.snap 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`destructuring.js 1`] = `
  3. const [one, two = null, three = null] = arr;
  4. a = ([s=1,]) => 1
  5. const { children, ...props } = this.props
  6. const { user: { firstName, lastName } } = this.props;
  7. const {
  8. name: { first, last },
  9. organisation: { address: { street: orgStreetAddress, postcode: orgPostcode } }
  10. } = user;
  11. function f({ data: { name } }) {}
  12. const UserComponent = function({
  13. name: { first, last },
  14. organisation: { address: { street: orgStreetAddress, postcode: orgPostcode } },
  15. }) {
  16. return
  17. };
  18. const { a, b, c, d: { e } } = someObject;
  19. try {
  20. // code
  21. } catch ({ data: { message }}) {
  22. // code
  23. }
  24. try {
  25. // code
  26. } catch ({ data: { message: { errors }}}) {
  27. // code
  28. }
  29. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  30. const [one, two = null, three = null] = arr;
  31. a = ([s = 1]) => 1;
  32. const { children, ...props } = this.props;
  33. const {
  34. user: { firstName, lastName }
  35. } = this.props;
  36. const {
  37. name: { first, last },
  38. organisation: {
  39. address: { street: orgStreetAddress, postcode: orgPostcode }
  40. }
  41. } = user;
  42. function f({ data: { name } }) {}
  43. const UserComponent = function({
  44. name: { first, last },
  45. organisation: {
  46. address: { street: orgStreetAddress, postcode: orgPostcode }
  47. }
  48. }) {
  49. return;
  50. };
  51. const {
  52. a,
  53. b,
  54. c,
  55. d: { e }
  56. } = someObject;
  57. try {
  58. // code
  59. } catch ({ data: { message } }) {
  60. // code
  61. }
  62. try {
  63. // code
  64. } catch ({
  65. data: {
  66. message: { errors }
  67. }
  68. }) {
  69. // code
  70. }
  71. `;