jsfmt.spec.js.snap 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`binary.js 1`] = `
  3. (class {}) + 1;
  4. (class a {}) + 1;
  5. (class extends b {}) + 1;
  6. (class a extends b {}) + 1;
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. (class {} + 1);
  9. (class a {} + 1);
  10. (class extends b {} + 1);
  11. (class a extends b {} + 1);
  12. `;
  13. exports[`break.js 1`] = `
  14. class MyContractSelectionWidget extends React.Component<void, MyContractSelectionWidgetPropsType, void> implements SomethingLarge {
  15. method() {}
  16. }
  17. class DisplayObject
  18. extends utils.EventEmitter
  19. implements interaction_InteractiveTarget {
  20. }
  21. class DisplayObject extends utils.EventEmitter
  22. implements interaction_InteractiveTarget {
  23. }
  24. class DisplayObject extends utils.EventEmitter
  25. implements interaction_InteractiveTarget,
  26. somethingElse_SomeOtherThing,
  27. somethingElseAgain_RunningOutOfNames {
  28. }
  29. class DisplayObject extends utils.EventEmitter implements interaction_InteractiveTarget {}
  30. class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
  31. class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
  32. class Foo extends Immutable.Record({
  33. ipaddress: '',
  34. }) {
  35. ipaddress: string;
  36. }
  37. export class VisTimelineComponent
  38. implements AfterViewInit, OnChanges, OnDestroy {
  39. }
  40. export class VisTimelineComponent2
  41. implements AfterViewInit, OnChanges, OnDestroy, AndSomethingReallyReallyLong {
  42. }
  43. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  44. class MyContractSelectionWidget
  45. extends React.Component<void, MyContractSelectionWidgetPropsType, void>
  46. implements SomethingLarge {
  47. method() {}
  48. }
  49. class DisplayObject extends utils.EventEmitter
  50. implements interaction_InteractiveTarget {}
  51. class DisplayObject extends utils.EventEmitter
  52. implements interaction_InteractiveTarget {}
  53. class DisplayObject extends utils.EventEmitter
  54. implements
  55. interaction_InteractiveTarget,
  56. somethingElse_SomeOtherThing,
  57. somethingElseAgain_RunningOutOfNames {}
  58. class DisplayObject extends utils.EventEmitter
  59. implements interaction_InteractiveTarget {}
  60. class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
  61. class InMemoryAppender extends log4javascript.Appender
  62. implements ICachedLogMessageProvider {}
  63. class Foo extends Immutable.Record({
  64. ipaddress: ""
  65. }) {
  66. ipaddress: string;
  67. }
  68. export class VisTimelineComponent
  69. implements AfterViewInit, OnChanges, OnDestroy {}
  70. export class VisTimelineComponent2
  71. implements
  72. AfterViewInit,
  73. OnChanges,
  74. OnDestroy,
  75. AndSomethingReallyReallyLong {}
  76. `;
  77. exports[`call.js 1`] = `
  78. (class {})(class {});
  79. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. (class {}(class {}));
  81. `;
  82. exports[`empty.js 1`] = `
  83. class A {
  84. // comment
  85. }
  86. class A { // comment
  87. }
  88. class A {
  89. }
  90. class A {
  91. m() {}
  92. }
  93. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. class A {
  95. // comment
  96. }
  97. class A {
  98. // comment
  99. }
  100. class A {}
  101. class A {
  102. m() {}
  103. }
  104. `;
  105. exports[`member.js 1`] = `
  106. (class {})[1];
  107. (class {}).a;
  108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. (class {}[1]);
  110. (class {}.a);
  111. `;
  112. exports[`method.js 1`] = `
  113. class C {
  114. name/*comment*/() {
  115. }
  116. };
  117. ({
  118. name/*comment*/() {
  119. }
  120. });
  121. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. class C {
  123. name /*comment*/() {}
  124. }
  125. ({
  126. name /*comment*/() {}
  127. });
  128. `;
  129. exports[`property.js 1`] = `
  130. class A {
  131. foobar =
  132. // comment to break
  133. 1 +
  134. // comment to break again
  135. 2;
  136. }
  137. class B {
  138. someInstanceProperty = this.props.foofoofoofoofoofoo &&
  139. this.props.barbarbarbar;
  140. someInstanceProperty2 = { foo: this.props.foofoofoofoofoofoo &&
  141. this.props.barbarbarbar };
  142. someInstanceProperty3 =
  143. "foo";
  144. }
  145. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  146. class A {
  147. foobar =
  148. // comment to break
  149. 1 +
  150. // comment to break again
  151. 2;
  152. }
  153. class B {
  154. someInstanceProperty =
  155. this.props.foofoofoofoofoofoo && this.props.barbarbarbar;
  156. someInstanceProperty2 = {
  157. foo: this.props.foofoofoofoofoofoo && this.props.barbarbarbar
  158. };
  159. someInstanceProperty3 = "foo";
  160. }
  161. `;
  162. exports[`ternary.js 1`] = `
  163. if (1) (class {}) ? 1 : 2;
  164. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  165. if (1) (class {} ? 1 : 2);
  166. `;