From 9179f4ca42c81f9ebd6e054abe2ff5bb39a69554 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 1 Jun 2016 10:43:39 -0700 Subject: [PATCH] Fix test --- tests/baselines/reference/moduleResolution.js | 1 + .../reference/moduleResolution.symbols | 17 +++--- .../reference/moduleResolution.trace.json | 52 +++++++++---------- .../reference/moduleResolution.types | 17 +++--- tests/cases/compiler/moduleResolution.ts | 15 +++--- 5 files changed, 53 insertions(+), 49 deletions(-) diff --git a/tests/baselines/reference/moduleResolution.js b/tests/baselines/reference/moduleResolution.js index be81b926062..101089b6355 100644 --- a/tests/baselines/reference/moduleResolution.js +++ b/tests/baselines/reference/moduleResolution.js @@ -1,6 +1,7 @@ //// [tests/cases/compiler/moduleResolution.ts] //// //// [a.ts] + export default 0; // No extension: '.ts' added diff --git a/tests/baselines/reference/moduleResolution.symbols b/tests/baselines/reference/moduleResolution.symbols index 2a51d416a4a..e9934946a64 100644 --- a/tests/baselines/reference/moduleResolution.symbols +++ b/tests/baselines/reference/moduleResolution.symbols @@ -1,22 +1,23 @@ -=== tests/cases/compiler/a.ts === -export default 0; +=== /src/a.ts === + +No type information for this code.export default 0; No type information for this code. No type information for this code.// No extension: '.ts' added -No type information for this code.=== tests/cases/compiler/b.ts === +No type information for this code.=== /src/b.ts === import a from './a'; >a : Symbol(a, Decl(b.ts, 0, 6)) // Matching extension -=== tests/cases/compiler/c.ts === +=== /src/c.ts === import a from './a.ts'; >a : Symbol(a, Decl(c.ts, 0, 6)) // '.js' extension: stripped and replaced with '.ts' -=== tests/cases/compiler/d.ts === +=== /src/d.ts === import a from './a.js'; >a : Symbol(a, Decl(d.ts, 0, 6)) -=== tests/cases/compiler/jquery.d.ts === +=== /src/jquery.d.ts === declare var x: number; >x : Symbol(x, Decl(jquery.d.ts, 0, 11)) @@ -24,12 +25,12 @@ export default x; >x : Symbol(x, Decl(jquery.d.ts, 0, 11)) // No extension: '.d.ts' added -=== tests/cases/compiler/jquery_user_1.ts === +=== /src/jquery_user_1.ts === import j from "./jquery"; >j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) // '.js' extension: stripped and replaced with '.d.ts' -=== tests/cases/compiler/jquery_user_1.ts === +=== /src/jquery_user_1.ts === import j from "./jquery.js" >j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) >j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) diff --git a/tests/baselines/reference/moduleResolution.trace.json b/tests/baselines/reference/moduleResolution.trace.json index f51251810a7..6e6589d7c1f 100644 --- a/tests/baselines/reference/moduleResolution.trace.json +++ b/tests/baselines/reference/moduleResolution.trace.json @@ -1,32 +1,32 @@ [ - "======== Resolving module './a' from 'C:/Users/anhans/TypeScript/tests/cases/compiler/b.ts'. ========", + "======== Resolving module './a' from '/src/b.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'C:/Users/anhans/TypeScript/tests/cases/compiler/a'.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts' exist - use it as a name resolution result.", - "======== Module name './a' was successfully resolved to 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts'. ========", - "======== Resolving module './a.ts' from 'C:/Users/anhans/TypeScript/tests/cases/compiler/c.ts'. ========", + "Loading module as file / folder, candidate module location '/src/a'.", + "File '/src/a.ts' exist - use it as a name resolution result.", + "======== Module name './a' was successfully resolved to '/src/a.ts'. ========", + "======== Resolving module './a.ts' from '/src/c.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts'.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts' exist - use it as a name resolution result.", - "======== Module name './a.ts' was successfully resolved to 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts'. ========", - "======== Resolving module './a.js' from 'C:/Users/anhans/TypeScript/tests/cases/compiler/d.ts'. ========", + "Loading module as file / folder, candidate module location '/src/a.ts'.", + "File '/src/a.ts' exist - use it as a name resolution result.", + "======== Module name './a.ts' was successfully resolved to '/src/a.ts'. ========", + "======== Resolving module './a.js' from '/src/d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.js'.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.js.ts' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.js.tsx' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.js.d.ts' does not exist.", - "File name 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.js' has a '.js' extension - stripping it", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts' exist - use it as a name resolution result.", - "======== Module name './a.js' was successfully resolved to 'C:/Users/anhans/TypeScript/tests/cases/compiler/a.ts'. ========", - "======== Resolving module './jquery.js' from 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery_user_1.ts'. ========", + "Loading module as file / folder, candidate module location '/src/a.js'.", + "File '/src/a.js.ts' does not exist.", + "File '/src/a.js.tsx' does not exist.", + "File '/src/a.js.d.ts' does not exist.", + "File name '/src/a.js' has a '.js' extension - stripping it", + "File '/src/a.ts' exist - use it as a name resolution result.", + "======== Module name './a.js' was successfully resolved to '/src/a.ts'. ========", + "======== Resolving module './jquery.js' from '/src/jquery_user_1.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.js'.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.js.ts' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.js.tsx' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.js.d.ts' does not exist.", - "File name 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.js' has a '.js' extension - stripping it", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.ts' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.tsx' does not exist.", - "File 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.d.ts' exist - use it as a name resolution result.", - "======== Module name './jquery.js' was successfully resolved to 'C:/Users/anhans/TypeScript/tests/cases/compiler/jquery.d.ts'. ========" + "Loading module as file / folder, candidate module location '/src/jquery.js'.", + "File '/src/jquery.js.ts' does not exist.", + "File '/src/jquery.js.tsx' does not exist.", + "File '/src/jquery.js.d.ts' does not exist.", + "File name '/src/jquery.js' has a '.js' extension - stripping it", + "File '/src/jquery.ts' does not exist.", + "File '/src/jquery.tsx' does not exist.", + "File '/src/jquery.d.ts' exist - use it as a name resolution result.", + "======== Module name './jquery.js' was successfully resolved to '/src/jquery.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolution.types b/tests/baselines/reference/moduleResolution.types index 2e1b0f560bc..fbc0091ee3b 100644 --- a/tests/baselines/reference/moduleResolution.types +++ b/tests/baselines/reference/moduleResolution.types @@ -1,22 +1,23 @@ -=== tests/cases/compiler/a.ts === -export default 0; +=== /src/a.ts === + +No type information for this code.export default 0; No type information for this code. No type information for this code.// No extension: '.ts' added -No type information for this code.=== tests/cases/compiler/b.ts === +No type information for this code.=== /src/b.ts === import a from './a'; >a : number // Matching extension -=== tests/cases/compiler/c.ts === +=== /src/c.ts === import a from './a.ts'; >a : number // '.js' extension: stripped and replaced with '.ts' -=== tests/cases/compiler/d.ts === +=== /src/d.ts === import a from './a.js'; >a : number -=== tests/cases/compiler/jquery.d.ts === +=== /src/jquery.d.ts === declare var x: number; >x : number @@ -24,12 +25,12 @@ export default x; >x : number // No extension: '.d.ts' added -=== tests/cases/compiler/jquery_user_1.ts === +=== /src/jquery_user_1.ts === import j from "./jquery"; >j : number // '.js' extension: stripped and replaced with '.d.ts' -=== tests/cases/compiler/jquery_user_1.ts === +=== /src/jquery_user_1.ts === import j from "./jquery.js" >j : number >j : number diff --git a/tests/cases/compiler/moduleResolution.ts b/tests/cases/compiler/moduleResolution.ts index 0af824100a7..6ad35658623 100644 --- a/tests/cases/compiler/moduleResolution.ts +++ b/tests/cases/compiler/moduleResolution.ts @@ -1,27 +1,28 @@ // @traceResolution: true -// @Filename: a.ts + +// @Filename: /src/a.ts export default 0; // No extension: '.ts' added -// @Filename: b.ts +// @Filename: /src/b.ts import a from './a'; // Matching extension -// @Filename: c.ts +// @Filename: /src/c.ts import a from './a.ts'; // '.js' extension: stripped and replaced with '.ts' -// @Filename: d.ts +// @Filename: /src/d.ts import a from './a.js'; -// @Filename: jquery.d.ts +// @Filename: /src/jquery.d.ts declare var x: number; export default x; // No extension: '.d.ts' added -// @Filename: jquery_user_1.ts +// @Filename: /src/jquery_user_1.ts import j from "./jquery"; // '.js' extension: stripped and replaced with '.d.ts' -// @Filename: jquery_user_1.ts +// @Filename: /src/jquery_user_1.ts import j from "./jquery.js"