2017-04-08 17:52:38 +03:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
exports[`test.js 1`] = `
|
2017-04-12 23:41:51 +03:00
|
|
|
// @flow
|
2017-04-08 17:52:38 +03:00
|
|
|
|
|
|
|
const Immutable = require('immutable');
|
|
|
|
|
|
|
|
const tasksPerStatusMap = new Map(
|
|
|
|
[].map(taskStatus => [taskStatus, new Map()]),
|
|
|
|
);
|
|
|
|
for (let [taskStatus, tasksMap] of tasksPerStatusMap) {
|
|
|
|
tasksPerStatusMap.set(taskStatus, Immutable.Map(tasksMap));
|
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
const Immutable = require("immutable");
|
2017-04-08 17:52:38 +03:00
|
|
|
|
|
|
|
const tasksPerStatusMap = new Map(
|
|
|
|
[].map(taskStatus => [taskStatus, new Map()])
|
|
|
|
);
|
|
|
|
for (let [taskStatus, tasksMap] of tasksPerStatusMap) {
|
|
|
|
tasksPerStatusMap.set(taskStatus, Immutable.Map(tasksMap));
|
|
|
|
}
|
2017-04-12 23:41:51 +03:00
|
|
|
|
2017-04-08 17:52:38 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test2.js 1`] = `
|
2017-04-12 23:41:51 +03:00
|
|
|
/* @flow */
|
2017-04-08 17:52:38 +03:00
|
|
|
|
|
|
|
declare class Bar<K> {
|
|
|
|
update<K_>(updater: (value: this) => Bar<K_>): Bar<K_>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare function foo<U>(
|
|
|
|
initialValue: U,
|
|
|
|
callbackfn: (previousValue: U) => U
|
|
|
|
): U;
|
|
|
|
|
|
|
|
declare var items: Bar<string>;
|
|
|
|
declare var updater: (value: Bar<string>) => Bar<string>;
|
|
|
|
|
|
|
|
foo(
|
|
|
|
items,
|
|
|
|
(acc) => acc.update(updater)
|
|
|
|
);
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
/* @flow */
|
|
|
|
|
|
|
|
declare class Bar<K> {
|
|
|
|
update<K_>(updater: (value: this) => Bar<K_>): Bar<K_>
|
|
|
|
}
|
|
|
|
|
|
|
|
declare function foo<U>(
|
|
|
|
initialValue: U,
|
|
|
|
callbackfn: (previousValue: U) => U
|
|
|
|
): U;
|
|
|
|
|
|
|
|
declare var items: Bar<string>;
|
|
|
|
declare var updater: (value: Bar<string>) => Bar<string>;
|
|
|
|
|
|
|
|
foo(items, acc => acc.update(updater));
|
2017-04-12 23:41:51 +03:00
|
|
|
|
2017-04-08 17:52:38 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test3.js 1`] = `
|
2017-04-12 23:41:51 +03:00
|
|
|
// @flow
|
2017-04-08 17:52:38 +03:00
|
|
|
|
|
|
|
declare class ImmBox<T> {
|
|
|
|
static <U>(x: any): ImmBox<U>;
|
|
|
|
static (x: any): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class Box<T> {
|
|
|
|
constructor(x: T): void;
|
|
|
|
set(value: T): void;
|
|
|
|
get(): T;
|
|
|
|
}
|
|
|
|
|
|
|
|
const outer = new Box();
|
|
|
|
const inner = outer.get();
|
|
|
|
outer.set(ImmBox(inner));
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
|
|
|
|
|
|
|
declare class ImmBox<T> {
|
|
|
|
static <U>(x: any): ImmBox<U>,
|
|
|
|
static (x: any): any
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class Box<T> {
|
|
|
|
constructor(x: T): void,
|
|
|
|
set(value: T): void,
|
|
|
|
get(): T
|
|
|
|
}
|
|
|
|
|
|
|
|
const outer = new Box();
|
|
|
|
const inner = outer.get();
|
|
|
|
outer.set(ImmBox(inner));
|
2017-04-12 23:41:51 +03:00
|
|
|
|
2017-04-08 17:52:38 +03:00
|
|
|
`;
|