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

138 lines
2.5 KiB
Plaintext

exports[`test Parent.js 1`] = `
"// @flow
var ParentFoo = {foo: \'bar\'};
module.exports = {ParentFoo};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
var ParentFoo = { foo: \"bar\" };
module.exports = { ParentFoo };
"
`;
exports[`test 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\';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @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\";
"
`;
exports[`test 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[`test 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[`test types.js 1`] = `
"// @flow
export type Foo = {};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow
export type Foo = {};
"
`;