diff --git a/test/__snapshots__/runner.ts.snap b/test/__snapshots__/runner.ts.snap new file mode 100644 index 0000000..2b0b730 --- /dev/null +++ b/test/__snapshots__/runner.ts.snap @@ -0,0 +1,523 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`collapse intersection interfaces collapse-intersection-interfaces-transform advanced 1`] = ` +"type Foo = { + foo: string; + stuff: boolean; + other: () => void; + bar: number; + [key: string]: number; +};" +`; + +exports[`collapse intersection interfaces collapse-intersection-interfaces-transform empty-empty 1`] = ` +"type Foo = { +};" +`; + +exports[`collapse intersection interfaces collapse-intersection-interfaces-transform simple 1`] = ` +"type Foo = { + foo: string; + bar: number; +};" +`; + +exports[`end to end end-to-end basic 1`] = ` +"import * as React from 'react'; +export default class MyComponent extends React.Component<{ + }, { + }> { + render() { + return
; + } +}" +`; + +exports[`end to end end-to-end initial-state-and-proprypes 1`] = ` +"import * as React from 'react'; +type MyComponentProps = { + baz: string; +}; +type MyComponentState = { + foo: number; + bar: string; +}; +export default class MyComponent extends React.Component { + state = { foo: 1, bar: 'str' }; + render() { + return
; + } +}" +`; + +exports[`end to end end-to-end initial-state-and-proprypes-and-set-state 1`] = ` +"import * as React from 'react'; +type MyComponentProps = { + baz: string; +}; +type MyComponentState = { + dynamicState: number; + foo: number; + bar: string; +}; +export default class MyComponent extends React.Component { + state = { foo: 1, bar: 'str' }; + render() { + return
; + } + otherFn() { + this.setState({ dynamicState: 42 }); + } +}" +`; + +exports[`end to end end-to-end non-react 1`] = ` +"class Foo { + render() { + return '100'; + } +} +class Bar extends Foo { + baz() { + } +}" +`; + +exports[`end to end end-to-end stateless-arrow-function 1`] = ` +"type HelloProps = { + message?: string; +}; +const Hello: React.SFC = ({ message }) => { + return
hello {message}
; +};" +`; + +exports[`end to end end-to-end stateless-function 1`] = ` +"type HelloProps = { + message?: string; +}; +export const Hello: React.SFC = ({ message }) => { + return
hello {message}
; +};" +`; + +exports[`react js make props and state react-js-make-props-and-state-transform non-react 1`] = ` +"interface IFoo { +} +class Foo { +} +class Bar extends Foo { +} +class Foo2 implements IFoo { +} +class Bar2 extends Foo implements IFoo { +}" +`; + +exports[`react js make props and state react-js-make-props-and-state-transform propless-stateless 1`] = ` +"import * as React from 'react'; +export default class MyComponent extends React.Component<{ + }, { + }> { + render() { + return
; + } +}" +`; + +exports[`react js make props and state react-js-make-props-and-state-transform set-state-advanced 1`] = ` +"import * as React from 'react'; +type MyComponentState = { foo: number; bar: number; } & { baz: number; } & { something: { big: number; here: string; of: { a: number; }[]; }; }; +export default class MyComponent extends React.Component<{ + }, MyComponentState> { + render() { + return