2017-02-22 00:59:19 +03:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
2018-11-25 11:21:14 +03:00
|
|
|
exports[`es_declare_module.js 1`] = `
|
|
|
|
====================================options=====================================
|
|
|
|
parsers: ["flow", "babylon"]
|
|
|
|
printWidth: 80
|
|
|
|
| printWidth
|
|
|
|
=====================================input======================================
|
2017-04-12 23:41:51 +03:00
|
|
|
// @flow
|
2016-12-23 22:31:38 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {num1, str1} from "CJS_Named";
|
|
|
|
import CJS_Named from "CJS_Named";
|
2016-12-23 22:31:38 +03:00
|
|
|
(num1: number);
|
|
|
|
(num1: string); // Error: number ~> string
|
|
|
|
(str1: string);
|
|
|
|
(str1: number); // Error: string ~> number
|
|
|
|
(CJS_Named: {num1: number, str1: string});
|
|
|
|
(CJS_Named: number); // Error: Module ~> number
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {num2} from "CJS_Clobbered"; // Error: No such export!
|
|
|
|
import {numExport} from "CJS_Clobbered";
|
2016-12-23 22:31:38 +03:00
|
|
|
(numExport: number);
|
|
|
|
(numExport: string); // Error: number ~> string
|
2017-04-12 23:41:51 +03:00
|
|
|
import type {numType} from "CJS_Clobbered";
|
2016-12-23 22:31:38 +03:00
|
|
|
(42: numType);
|
2017-02-22 00:59:19 +03:00
|
|
|
('asdf': numType); // Error: string ~> number
|
2016-12-23 22:31:38 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {strHidden} from "ES"; // Error: No such export!
|
|
|
|
import {str3} from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(str3: string);
|
|
|
|
(str3: number); // Error: string ~> number
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {num3} from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(num3: number);
|
|
|
|
(num3: string); // Error: number ~> string
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {C} from "ES";
|
|
|
|
import type {C as CType} from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(new C(): C);
|
|
|
|
(42: C); // Error: number ~> C
|
|
|
|
(new C(): CType);
|
|
|
|
(42: CType); // Error: number ~> CType
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {T} from "ES"; // Error: T is a type import, not a value
|
|
|
|
import type {T as T2} from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(42: T2);
|
2017-02-22 00:59:19 +03:00
|
|
|
('asdf': T2); // Error: string ~> number
|
2016-12-23 22:31:38 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import {exports as nope} from "ES"; // Error: Not an export
|
2018-11-25 11:21:14 +03:00
|
|
|
|
|
|
|
=====================================output=====================================
|
2016-12-23 22:31:38 +03:00
|
|
|
// @flow
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { num1, str1 } from "CJS_Named";
|
|
|
|
import CJS_Named from "CJS_Named";
|
2016-12-23 22:31:38 +03:00
|
|
|
(num1: number);
|
2017-01-26 22:57:43 +03:00
|
|
|
(num1: string); // Error: number ~> string
|
2016-12-23 22:31:38 +03:00
|
|
|
(str1: string);
|
2017-01-26 22:57:43 +03:00
|
|
|
(str1: number); // Error: string ~> number
|
2017-01-05 01:26:44 +03:00
|
|
|
(CJS_Named: { num1: number, str1: string });
|
2017-01-26 22:57:43 +03:00
|
|
|
(CJS_Named: number); // Error: Module ~> number
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { num2 } from "CJS_Clobbered"; // Error: No such export!
|
|
|
|
import { numExport } from "CJS_Clobbered";
|
2016-12-23 22:31:38 +03:00
|
|
|
(numExport: number);
|
2017-01-26 22:57:43 +03:00
|
|
|
(numExport: string); // Error: number ~> string
|
2017-04-12 23:41:51 +03:00
|
|
|
import type { numType } from "CJS_Clobbered";
|
2016-12-28 05:40:04 +03:00
|
|
|
(42: numType);
|
2017-04-12 23:41:51 +03:00
|
|
|
("asdf": numType); // Error: string ~> number
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { strHidden } from "ES"; // Error: No such export!
|
|
|
|
import { str3 } from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(str3: string);
|
2017-01-26 22:57:43 +03:00
|
|
|
(str3: number); // Error: string ~> number
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { num3 } from "ES";
|
2016-12-23 22:31:38 +03:00
|
|
|
(num3: number);
|
2017-01-26 22:57:43 +03:00
|
|
|
(num3: string); // Error: number ~> string
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { C } from "ES";
|
|
|
|
import type { C as CType } from "ES";
|
2017-01-11 02:51:46 +03:00
|
|
|
(new C(): C);
|
2017-01-26 22:57:43 +03:00
|
|
|
(42: C); // Error: number ~> C
|
2017-01-11 02:51:46 +03:00
|
|
|
(new C(): CType);
|
2017-01-26 22:57:43 +03:00
|
|
|
(42: CType); // Error: number ~> CType
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
import { T } from "ES"; // Error: T is a type import, not a value
|
|
|
|
import type { T as T2 } from "ES";
|
2016-12-28 05:40:04 +03:00
|
|
|
(42: T2);
|
2017-04-12 23:41:51 +03:00
|
|
|
("asdf": T2); // Error: string ~> number
|
|
|
|
|
|
|
|
import { exports as nope } from "ES"; // Error: Not an export
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2018-11-25 11:21:14 +03:00
|
|
|
================================================================================
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|