prettier/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap

116 lines
2.6 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Traces.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
| printWidth
=====================================input======================================
// arg/param type mismatch on arg 0
function g0(y:string) { }
function f0(x) { g0(x) }
f0(0);
// ...on arg n
function g1(a:string, b:string) { }
function f1(x, y) { g1(x, y) }
f1("hey", 0);
// h/o call with function expr
function g2(ylam: (s:string) => number) { }
function f2(xlam) { g2(xlam) }
f2(function(x) { return x * x });
// h/o call with function def
function g3(ylam: (s:string) => number) { }
function f3(xlam) { g3(xlam) }
function double(n) { return n * 2 }
f3(double);
=====================================output=====================================
// arg/param type mismatch on arg 0
function g0(y: string) {}
function f0(x) {
g0(x);
}
f0(0);
// ...on arg n
function g1(a: string, b: string) {}
function f1(x, y) {
g1(x, y);
}
f1("hey", 0);
// h/o call with function expr
function g2(ylam: (s: string) => number) {}
function f2(xlam) {
g2(xlam);
}
f2(function(x) {
return x * x;
});
// h/o call with function def
function g3(ylam: (s: string) => number) {}
function f3(xlam) {
g3(xlam);
}
function double(n) {
return n * 2;
}
f3(double);
================================================================================
`;
exports[`Traces2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
| printWidth
=====================================input======================================
// @flow
var React = require('react');
var A = React.createClass({
propTypes: { foo: React.PropTypes.string.isRequired }
});
var B = React.createClass({
propTypes: { bar: React.PropTypes.string.isRequired }
});
function f(b): React.Element<*> {
if (b) {
return <A foo="hey"/>;
} else {
return <B bar="hey"/>;
}
}
=====================================output=====================================
// @flow
var React = require("react");
var A = React.createClass({
propTypes: { foo: React.PropTypes.string.isRequired }
});
var B = React.createClass({
propTypes: { bar: React.PropTypes.string.isRequired }
});
function f(b): React.Element<*> {
if (b) {
return <A foo="hey" />;
} else {
return <B bar="hey" />;
}
}
================================================================================
`;