mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Add rootDir tests
This commit is contained in:
2
tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts
vendored
Normal file
2
tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare class C {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
|
||||
4
tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts
vendored
Normal file
4
tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference path="FolderC/fileC.d.ts" />
|
||||
declare class B {
|
||||
c: C;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"declaration": true,
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderB/FolderC/fileC.js",
|
||||
"outdir/simple/FolderB/FolderC/fileC.d.ts",
|
||||
"outdir/simple/FolderB/fileB.js",
|
||||
"outdir/simple/FolderB/fileB.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
===================================================================
|
||||
JsFile: fileC.js
|
||||
mapUrl: fileC.js.map
|
||||
sourceRoot:
|
||||
sources: ../../../../FolderA/FolderB/FolderC/fileC.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/FolderC/fileC.js
|
||||
sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var C = (function () {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C() {
|
||||
1->^^^^
|
||||
2 > ^^->
|
||||
1->
|
||||
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class C {
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
|
||||
2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
|
||||
---
|
||||
>>> return C;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class C {
|
||||
> }
|
||||
1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
|
||||
3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
|
||||
4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileC.js.map===================================================================
|
||||
JsFile: fileB.js
|
||||
mapUrl: fileB.js.map
|
||||
sourceRoot:
|
||||
sources: ../../../FolderA/FolderB/fileB.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/fileB.js
|
||||
sourceFile:../../../FolderA/FolderB/fileB.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >/// <reference path='FolderC/fileC.ts'/>
|
||||
>
|
||||
2 >
|
||||
3 >/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
|
||||
---
|
||||
>>>var B = (function () {
|
||||
>>> function B() {
|
||||
1 >^^^^
|
||||
2 > ^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class B {
|
||||
> public c: C;
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
|
||||
2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
|
||||
---
|
||||
>>> return B;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class B {
|
||||
> public c: C;
|
||||
> }
|
||||
1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
|
||||
3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileB.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
declare class C {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
|
||||
4
tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts
vendored
Normal file
4
tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference path="FolderC/fileC.d.ts" />
|
||||
declare class B {
|
||||
c: C;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"declaration": true,
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderB/FolderC/fileC.js",
|
||||
"outdir/simple/FolderB/FolderC/fileC.d.ts",
|
||||
"outdir/simple/FolderB/fileB.js",
|
||||
"outdir/simple/FolderB/fileB.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
===================================================================
|
||||
JsFile: fileC.js
|
||||
mapUrl: fileC.js.map
|
||||
sourceRoot:
|
||||
sources: ../../../../FolderA/FolderB/FolderC/fileC.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/FolderC/fileC.js
|
||||
sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var C = (function () {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C() {
|
||||
1->^^^^
|
||||
2 > ^^->
|
||||
1->
|
||||
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class C {
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
|
||||
2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
|
||||
---
|
||||
>>> return C;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class C {
|
||||
> }
|
||||
1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
|
||||
3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
|
||||
4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileC.js.map===================================================================
|
||||
JsFile: fileB.js
|
||||
mapUrl: fileB.js.map
|
||||
sourceRoot:
|
||||
sources: ../../../FolderA/FolderB/fileB.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/fileB.js
|
||||
sourceFile:../../../FolderA/FolderB/fileB.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >/// <reference path='FolderC/fileC.ts'/>
|
||||
>
|
||||
2 >
|
||||
3 >/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
|
||||
---
|
||||
>>>var B = (function () {
|
||||
>>> function B() {
|
||||
1 >^^^^
|
||||
2 > ^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class B {
|
||||
> public c: C;
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
|
||||
2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
|
||||
---
|
||||
>>> return B;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class B {
|
||||
> public c: C;
|
||||
> }
|
||||
1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
|
||||
3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileB.js.map
|
||||
2
tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts
vendored
Normal file
2
tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare class C {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
4
tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts
vendored
Normal file
4
tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference path="FolderC/fileC.d.ts" />
|
||||
declare class B {
|
||||
c: C;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
@@ -0,0 +1,14 @@
|
||||
error TS6059: File 'FolderA/FolderB/fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files.
|
||||
|
||||
|
||||
!!! error TS6059: File 'fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files.
|
||||
==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
|
||||
class C {
|
||||
}
|
||||
|
||||
==== FolderA/FolderB/fileB.ts (0 errors) ====
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
class B {
|
||||
public c: C;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"scenario": "rootDirectory: Files outside the rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"declaration": true,
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA/FolderB/FolderC",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderC/fileC.js",
|
||||
"outdir/simple/FolderC/fileC.d.ts",
|
||||
"outdir/simple/fileB.js",
|
||||
"outdir/simple/fileB.d.ts"
|
||||
]
|
||||
}
|
||||
2
tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts
vendored
Normal file
2
tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare class C {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
4
tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts
vendored
Normal file
4
tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference path="FolderC/fileC.d.ts" />
|
||||
declare class B {
|
||||
c: C;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
@@ -0,0 +1,14 @@
|
||||
error TS6059: File 'FolderA/FolderB/fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files.
|
||||
|
||||
|
||||
!!! error TS6059: File 'fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files.
|
||||
==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
|
||||
class C {
|
||||
}
|
||||
|
||||
==== FolderA/FolderB/fileB.ts (0 errors) ====
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
class B {
|
||||
public c: C;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"scenario": "rootDirectory: Files outside the rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"declaration": true,
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA/FolderB/FolderC",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderC/fileC.js",
|
||||
"outdir/simple/FolderC/fileC.d.ts",
|
||||
"outdir/simple/fileB.js",
|
||||
"outdir/simple/fileB.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
//# sourceMappingURL=fileC.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
//# sourceMappingURL=fileB.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory with sourceRoot",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "SourceRootPath",
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderB/FolderC/fileC.js.map",
|
||||
"outdir/simple/FolderB/FolderC/fileC.js",
|
||||
"outdir/simple/FolderB/fileB.js.map",
|
||||
"outdir/simple/FolderB/fileB.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
===================================================================
|
||||
JsFile: fileC.js
|
||||
mapUrl: fileC.js.map
|
||||
sourceRoot: SourceRootPath/
|
||||
sources: FolderB/FolderC/fileC.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/FolderC/fileC.js
|
||||
sourceFile:FolderB/FolderC/fileC.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var C = (function () {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C() {
|
||||
1->^^^^
|
||||
2 > ^^->
|
||||
1->
|
||||
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class C {
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
|
||||
2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
|
||||
---
|
||||
>>> return C;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class C {
|
||||
> }
|
||||
1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
|
||||
3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
|
||||
4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileC.js.map===================================================================
|
||||
JsFile: fileB.js
|
||||
mapUrl: fileB.js.map
|
||||
sourceRoot: SourceRootPath/
|
||||
sources: FolderB/fileB.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/fileB.js
|
||||
sourceFile:FolderB/fileB.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >/// <reference path='FolderC/fileC.ts'/>
|
||||
>
|
||||
2 >
|
||||
3 >/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
|
||||
---
|
||||
>>>var B = (function () {
|
||||
>>> function B() {
|
||||
1 >^^^^
|
||||
2 > ^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class B {
|
||||
> public c: C;
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
|
||||
2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
|
||||
---
|
||||
>>> return B;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class B {
|
||||
> public c: C;
|
||||
> }
|
||||
1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
|
||||
3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileB.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
//# sourceMappingURL=fileC.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
//# sourceMappingURL=fileB.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory with sourceRoot",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "SourceRootPath",
|
||||
"baselineCheck": true,
|
||||
"rootDir": "FolderA",
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"FolderA/FolderB/FolderC/fileC.ts",
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"outdir/simple/FolderB/FolderC/fileC.js.map",
|
||||
"outdir/simple/FolderB/FolderC/fileC.js",
|
||||
"outdir/simple/FolderB/fileB.js.map",
|
||||
"outdir/simple/FolderB/fileB.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
===================================================================
|
||||
JsFile: fileC.js
|
||||
mapUrl: fileC.js.map
|
||||
sourceRoot: SourceRootPath/
|
||||
sources: FolderB/FolderC/fileC.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/FolderC/fileC.js
|
||||
sourceFile:FolderB/FolderC/fileC.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var C = (function () {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C() {
|
||||
1->^^^^
|
||||
2 > ^^->
|
||||
1->
|
||||
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class C {
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
|
||||
2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
|
||||
---
|
||||
>>> return C;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class C {
|
||||
> }
|
||||
1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
|
||||
2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
|
||||
3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
|
||||
4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileC.js.map===================================================================
|
||||
JsFile: fileB.js
|
||||
mapUrl: fileB.js.map
|
||||
sourceRoot: SourceRootPath/
|
||||
sources: FolderB/fileB.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:outdir/simple/FolderB/fileB.js
|
||||
sourceFile:FolderB/fileB.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >/// <reference path='FolderC/fileC.ts'/>
|
||||
>
|
||||
2 >
|
||||
3 >/// <reference path='FolderC/fileC.ts'/>
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
|
||||
---
|
||||
>>>var B = (function () {
|
||||
>>> function B() {
|
||||
1 >^^^^
|
||||
2 > ^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class B {
|
||||
> public c: C;
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
|
||||
2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
|
||||
---
|
||||
>>> return B;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class B {
|
||||
> public c: C;
|
||||
> }
|
||||
1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
|
||||
2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
|
||||
3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=fileB.js.map
|
||||
12
tests/cases/project/rootDirectory.json
Normal file
12
tests/cases/project/rootDirectory.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"rootDir": "FolderA",
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"baselineCheck": true
|
||||
}
|
||||
11
tests/cases/project/rootDirectoryErrors.json
Normal file
11
tests/cases/project/rootDirectoryErrors.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"scenario": "rootDirectory: Files outside the rootDirectory",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"rootDir": "FolderA/FolderB/FolderC",
|
||||
"declaration": true,
|
||||
"baselineCheck": true
|
||||
}
|
||||
12
tests/cases/project/rootDirectoryWithSourceRoot.json
Normal file
12
tests/cases/project/rootDirectoryWithSourceRoot.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "rootDirectory: specify rootDirectory with sourceRoot",
|
||||
"projectRoot": "tests/cases/projects/rootDirectory",
|
||||
"inputFiles": [
|
||||
"FolderA/FolderB/fileB.ts"
|
||||
],
|
||||
"outDir": "outdir/simple",
|
||||
"rootDir": "FolderA",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "SourceRootPath",
|
||||
"baselineCheck": true
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
class C {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/// <reference path='FolderC/fileC.ts'/>
|
||||
class B {
|
||||
public c: C;
|
||||
}
|
||||
Reference in New Issue
Block a user