Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename tests, add node10 mode
  • Loading branch information
jakebailey committed Jan 10, 2023
commit f45a558e884f3525bf22b62b39686051eb78ad52
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// [tests/cases/compiler/suppressResolvedUsingTsExtension1.ts] ////
//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField1.ts] ////

//// [package.json]
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// [tests/cases/compiler/suppressResolvedUsingTsExtension2.ts] ////
//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField2.ts] ////

//// [bar.ts]
export const a = 1234;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tests/cases/compiler/test.ts(1,19): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.


==== tests/cases/compiler/tsconfig.json (0 errors) ====
{
"compilerOptions": {
"paths": {
"foo/*": ["./dist/*"],
"baz/*.ts": ["./types/*.d.ts"]
}
}
}

==== tests/cases/compiler/dist/bar.ts (0 errors) ====
export const a = 1234;

==== tests/cases/compiler/types/main.d.ts (0 errors) ====
export const b: string;

==== tests/cases/compiler/test.ts (1 errors) ====
import { a } from "foo/bar.ts";
~~~~~~~~~~~~
!!! error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { b } from "baz/main.ts";

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField2.ts] ////

//// [bar.ts]
export const a = 1234;

//// [main.d.ts]
export const b: string;

//// [test.ts]
import { a } from "foo/bar.ts";
import { b } from "baz/main.ts";


//// [bar.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
exports.a = 1234;
//// [test.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=== tests/cases/compiler/dist/bar.ts ===
export const a = 1234;
>a : Symbol(a, Decl(bar.ts, 0, 12))

=== tests/cases/compiler/types/main.d.ts ===
export const b: string;
>b : Symbol(b, Decl(main.d.ts, 0, 12))

=== tests/cases/compiler/test.ts ===
import { a } from "foo/bar.ts";
>a : Symbol(a, Decl(test.ts, 0, 8))

import { b } from "baz/main.ts";
>b : Symbol(b, Decl(test.ts, 1, 8))

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/compiler/dist/bar.ts ===
export const a = 1234;
>a : 1234
>1234 : 1234

=== tests/cases/compiler/types/main.d.ts ===
export const b: string;
>b : string

=== tests/cases/compiler/test.ts ===
import { a } from "foo/bar.ts";
>a : 1234

import { b } from "baz/main.ts";
>b : string

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @moduleResolution: bundler
// @moduleResolution: node10,bundler

// @filename: tsconfig.json
{
Expand Down