Files
test-repo/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap
T
Rogelio Guzman d45e157563 Upgrade to Jest 19 (#762)
* Upgrade to Jest 19

* Use exact versions for Jest
2017-02-21 13:59:19 -08:00

76 lines
1.6 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`array.js 1`] = `
"var a = [\\"...\\"];
var b = a.map (function (x) { return 0; });
var c: string = b[0]; // error: number !~> string
var array = [];
function f() {
array = array.map (function () { return \\"...\\"; });
var x:number = array[0]; // error: string !~> number
}
var Foo = require('./genericfoo');
var foo = new Foo();
function g() {
var foo1 = foo.map (function() { return \\"...\\"; });
var x:number = foo1.get(); // error: string !~> number
foo = foo1;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var a = [\\"...\\"];
var b = a.map(function(x) {
return 0;
});
var c: string = b[0]; // error: number !~> string
var array = [];
function f() {
array = array.map(function() {
return \\"...\\";
});
var x: number = array[0]; // error: string !~> number
}
var Foo = require(\\"./genericfoo\\");
var foo = new Foo();
function g() {
var foo1 = foo.map(function() {
return \\"...\\";
});
var x: number = foo1.get(); // error: string !~> number
foo = foo1;
}
"
`;
exports[`genericfoo.js 1`] = `
"class Foo<T> {
x:T;
self():Foo<T> { return this; }
map<U>(callbackfn: () => U): Foo<U> { return new Foo(); }
set(x:T): void { }
get(): T { return this.x; }
}
module.exports = Foo;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Foo<T> {
x: T;
self(): Foo<T> {
return this;
}
map<U>(callbackfn: () => U): Foo<U> {
return new Foo();
}
set(x: T): void {}
get(): T {
return this.x;
}
}
module.exports = Foo;
"
`;