// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`builtin.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @flow
 */

interface IHasLength {
  length: number;
}

var lengthTest1: IHasLength = [];
var lengthTest2: IHasLength = 'hello';
var lengthTest3: IHasLength = 123; // number doesn't have length
var lengthTest4: IHasLength = true; // bool doesn't have length

=====================================output=====================================
/**
 * @flow
 */

interface IHasLength {
  length: number;
}

var lengthTest1: IHasLength = [];
var lengthTest2: IHasLength = "hello";
var lengthTest3: IHasLength = 123; // number doesn't have length
var lengthTest4: IHasLength = true; // bool doesn't have length

================================================================================
`;

exports[`class.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @flow
 */

class ClassWithXString {
  x: string;
}

interface IHasXString {
  x: string;
}

interface IHasXNumber {
  x: number;
}

interface IHasYString {
  y: string;
}

var testInstance1: IHasXString = new ClassWithXString();
var testInstance2: IHasXNumber = new ClassWithXString(); // Error wrong type
var testInstance3: IHasYString = new ClassWithXString(); // Error missing prop

=====================================output=====================================
/**
 * @flow
 */

class ClassWithXString {
  x: string;
}

interface IHasXString {
  x: string;
}

interface IHasXNumber {
  x: number;
}

interface IHasYString {
  y: string;
}

var testInstance1: IHasXString = new ClassWithXString();
var testInstance2: IHasXNumber = new ClassWithXString(); // Error wrong type
var testInstance3: IHasYString = new ClassWithXString(); // Error missing prop

================================================================================
`;

exports[`obj.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @flow
 */

interface IHasXString {
  x: string;
}

var propTest1: IHasXString = { x: 'hello' };
var propTest2: IHasXString = { x: 123 }; // Error string != number
var propTest3: IHasXString = {}; // Property not found
var propTest4: IHasXString = ({}: Object);

function propTest5(y: {[key: string]: string}) {
  (y: IHasXString); // OK
}

function propTest6(y: {[key: string]: number}) {
  (y: IHasXString); // error: string != number
}

=====================================output=====================================
/**
 * @flow
 */

interface IHasXString {
  x: string;
}

var propTest1: IHasXString = { x: "hello" };
var propTest2: IHasXString = { x: 123 }; // Error string != number
var propTest3: IHasXString = {}; // Property not found
var propTest4: IHasXString = ({}: Object);

function propTest5(y: { [key: string]: string }) {
  (y: IHasXString); // OK
}

function propTest6(y: { [key: string]: number }) {
  (y: IHasXString); // error: string != number
}

================================================================================
`;

exports[`optional.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

interface HasOptional {
  a: string,
  b?: number,
};

var test1: HasOptional = { a: "hello" }

var test2: HasOptional = {}; // Error: missing property a

var test3: HasOptional = { a: "hello", b: true }; // Error: boolean ~> number

=====================================output=====================================
/* @flow */

interface HasOptional {
  a: string;
  b?: number;
}

var test1: HasOptional = { a: "hello" };

var test2: HasOptional = {}; // Error: missing property a

var test3: HasOptional = { a: "hello", b: true }; // Error: boolean ~> number

================================================================================
`;
