Files
test-repo/tests/traces/__snapshots__/jsfmt.spec.js.snap
T

106 lines
1.9 KiB
Plaintext

exports[`test Traces.js 1`] = `
"// 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);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// arg/param type mismatch on arg 0
// ...on arg n
// h/o call with function expr
// h/o call with function def
function g0(y: string) {}
function f0(x) {
g0(x);
}
f0(0);
function g1(a: string, b: string) {}
function f1(x, y) {
g1(x, y);
}
f1(\"hey\", 0);
function g2(ylam: (s: string) => number) {}
function f2(xlam) {
g2(xlam);
}
f2(function(x) {
return x * x;
});
function g3(ylam: (s: string) => number) {}
function f3(xlam) {
g3(xlam);
}
function double(n) {
return n * 2;
}
f3(double);
"
`;
exports[`test Traces2.js 1`] = `
"// @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\"/>;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @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\"/>;
}
}
"
`;