Skip to content

Commit 8af9a93

Browse files
authored
Use typescript.d.ts in APISample tests (#51061)
1 parent 4953316 commit 8af9a93

19 files changed

+81
-71
lines changed

src/harness/harnessIO.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ namespace Harness {
177177
}
178178

179179
export const libFolder = "built/local/";
180-
const tcServicesFileName = ts.combinePaths(libFolder, "typescriptServices.js");
181-
export const tcServicesFile = IO.readFile(tcServicesFileName) + IO.newLine() + `//# sourceURL=${IO.resolvePath(tcServicesFileName)}`;
182180

183181
export type SourceMapEmitterCallback = (
184182
emittedFile: string,

tests/baselines/reference/APISample_Watch.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_Watch.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_Watch.ts]

tests/baselines/reference/APISample_WatchWithDefaults.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_WatchWithDefaults.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_WatchWithDefaults.ts]

tests/baselines/reference/APISample_WatchWithOwnWatchHost.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_WatchWithOwnWatchHost.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_WatchWithOwnWatchHost.ts]

tests/baselines/reference/APISample_compile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_compile.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_compile.ts]

tests/baselines/reference/APISample_jsdoc.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_jsdoc.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_jsdoc.ts]

tests/baselines/reference/APISample_linter.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_linter.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_linter.ts]
@@ -68,7 +69,8 @@ fileNames.forEach(fileName => {
6869

6970
// delint it
7071
delint(sourceFile);
71-
});
72+
});
73+
7274

7375
//// [APISample_linter.js]
7476
"use strict";

tests/baselines/reference/APISample_parseConfig.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_parseConfig.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_parseConfig.ts]
@@ -40,7 +41,8 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
4041
return undefined;
4142
}
4243
return ts.createProgram(rootFiles, settings.options);
43-
}
44+
}
45+
4446

4547
//// [APISample_parseConfig.js]
4648
"use strict";

tests/baselines/reference/APISample_transform.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_transform.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_transform.ts]
@@ -20,7 +21,8 @@ const source = "let x: string = 'string'";
2021

2122
let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
2223

23-
console.log(JSON.stringify(result));
24+
console.log(JSON.stringify(result));
25+
2426

2527
//// [APISample_transform.js]
2628
"use strict";

tests/baselines/reference/APISample_watcher.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//// [tests/cases/compiler/APISample_watcher.ts] ////
22

3-
//// [index.d.ts]
4-
declare module "typescript" {
5-
export = ts;
3+
//// [package.json]
4+
{
5+
"name": "typescript",
6+
"types": "/.ts/typescript.d.ts"
67
}
78

89
//// [APISample_watcher.ts]

0 commit comments

Comments
 (0)