mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 17:30:04 -05:00
Add test for function export
This commit is contained in:
16
tests/baselines/reference/umd7.js
Normal file
16
tests/baselines/reference/umd7.js
Normal file
@@ -0,0 +1,16 @@
|
||||
//// [tests/cases/conformance/externalModules/umd7.ts] ////
|
||||
|
||||
//// [foo.d.ts]
|
||||
|
||||
declare function Thing(): number;
|
||||
export = Thing;
|
||||
export as namespace Foo;
|
||||
|
||||
//// [a.ts]
|
||||
/// <reference path="foo.d.ts" />
|
||||
let y: number = Foo();
|
||||
|
||||
|
||||
//// [a.js]
|
||||
/// <reference path="foo.d.ts" />
|
||||
var y = exports.Foo();
|
||||
16
tests/baselines/reference/umd7.symbols
Normal file
16
tests/baselines/reference/umd7.symbols
Normal file
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/conformance/externalModules/a.ts ===
|
||||
/// <reference path="foo.d.ts" />
|
||||
let y: number = Foo();
|
||||
>y : Symbol(y, Decl(a.ts, 1, 3))
|
||||
>Foo : Symbol(Foo, Decl(foo.d.ts, 2, 15))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo.d.ts ===
|
||||
|
||||
declare function Thing(): number;
|
||||
>Thing : Symbol(Thing, Decl(foo.d.ts, 0, 0))
|
||||
|
||||
export = Thing;
|
||||
>Thing : Symbol(Thing, Decl(foo.d.ts, 0, 0))
|
||||
|
||||
export as namespace Foo;
|
||||
|
||||
18
tests/baselines/reference/umd7.types
Normal file
18
tests/baselines/reference/umd7.types
Normal file
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/conformance/externalModules/a.ts ===
|
||||
/// <reference path="foo.d.ts" />
|
||||
let y: number = Foo();
|
||||
>y : number
|
||||
>Foo() : number
|
||||
>Foo : () => number
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo.d.ts ===
|
||||
|
||||
declare function Thing(): number;
|
||||
>Thing : () => number
|
||||
|
||||
export = Thing;
|
||||
>Thing : () => number
|
||||
|
||||
export as namespace Foo;
|
||||
>Foo : any
|
||||
|
||||
11
tests/cases/conformance/externalModules/umd7.ts
Normal file
11
tests/cases/conformance/externalModules/umd7.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// @module: commonjs
|
||||
// @noImplicitReferences: true
|
||||
|
||||
// @filename: foo.d.ts
|
||||
declare function Thing(): number;
|
||||
export = Thing;
|
||||
export as namespace Foo;
|
||||
|
||||
// @filename: a.ts
|
||||
/// <reference path="foo.d.ts" />
|
||||
let y: number = Foo();
|
||||
Reference in New Issue
Block a user