prettier/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap

137 lines
2.5 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Parent.js 1`] = `
// @flow
var ParentFoo = {foo: 'bar'};
module.exports = {ParentFoo};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
var ParentFoo = { foo: "bar" };
module.exports = { ParentFoo };
`;
exports[`main.js 1`] = `
// @flow
var Parent = require('./Parent');
// Hops through destructuring
let ParentFoo;
({ParentFoo} = Parent);
ParentFoo; // Points to lval in line above this
// Follows assignment on simple/"non-destructuring" patterns
let ParentFoo2;
ParentFoo2 = Parent;
ParentFoo2; // Points to LHS of line above this
// Follows assignment with declaration
let ParentFoo3 = Parent;
ParentFoo3; // Points to LHS of line above this
// Follows non-destructured property access of \`require('Parent')\`
let foo = require('./Parent').ParentFoo.foo;
foo;
import type {Foo} from './types';
function takesFoo(foo: Foo) { }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
var Parent = require("./Parent");
// Hops through destructuring
let ParentFoo;
({ ParentFoo } = Parent);
ParentFoo; // Points to lval in line above this
// Follows assignment on simple/"non-destructuring" patterns
let ParentFoo2;
ParentFoo2 = Parent;
ParentFoo2; // Points to LHS of line above this
// Follows assignment with declaration
let ParentFoo3 = Parent;
ParentFoo3; // Points to LHS of line above this
// Follows non-destructured property access of \`require('Parent')\`
let foo = require("./Parent").ParentFoo.foo;
foo;
import type { Foo } from "./types";
function takesFoo(foo: Foo) {}
`;
exports[`override.js 1`] = `
// @flow
class C {
override() { }
}
class D extends C {
foo() { this.override() }
bar() { this.override }
override() { }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
class C {
override() {}
}
class D extends C {
foo() {
this.override();
}
bar() {
this.override;
}
override() {}
}
`;
exports[`react.js 1`] = `
var React = require('react');
class C extends React.Component {
props: { x: string };
}
let msg = "hello";
(<C x={msg}/>);
(<div id={msg}/>);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var React = require("react");
class C extends React.Component {
props: { x: string };
}
let msg = "hello";
<C x={msg} />;
<div id={msg} />;
`;
exports[`types.js 1`] = `
// @flow
export type Foo = {};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
export type Foo = {};
`;