Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discussion starter: specify ts version #62

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions libraries/typescript/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as ts from "@testable-ts/v3.0";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be a 3.0 version of typescript because newer typescript versions make use of non-downward-compatible typescript features in their types.

So testing 3.0 with types of 3.7 does not work, while testing 3.7 with types from 3.0 works just fine - especially as these types are just being used to interpret the code of tsd itself (I am not sure but I believe outside of the test suite this would not play any role at all).


export = ts;
2 changes: 2 additions & 0 deletions libraries/typescript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module.exports = require(process.env.TYPESCRIPT_PATH ||
__dirname + "/../shipped-typescript");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the magic happens: use the environment variable or fall back the shipped typescript version (current behaviour)

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"typedefinitions"
],
"dependencies": {
"@testable-ts/v3.0": "^3.0.3-alpha.0",
"eslint-formatter-pretty": "^1.3.0",
"globby": "^9.1.0",
"meow": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/handlers/assignability.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CallExpression} from '../../../../libraries/typescript/lib/typescript';
import {CallExpression} from '../../../../libraries/typescript';
import {TypeChecker} from '../../entities/typescript';
import {Diagnostic} from '../../interfaces';
import {makeDiagnostic} from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/handlers/expect-deprecated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {JSDocTagInfo} from '../../../../libraries/typescript/lib/typescript';
import {JSDocTagInfo} from '../../../../libraries/typescript';
import {Diagnostic} from '../../interfaces';
import {Handler} from './handler';
import {makeDiagnostic, tsutils} from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/handlers/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CallExpression} from '../../../../libraries/typescript/lib/typescript';
import {CallExpression} from '../../../../libraries/typescript';
import {TypeChecker} from '../../entities/typescript';
import {Diagnostic} from '../../interfaces';

Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/handlers/identicality.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CallExpression} from '../../../../libraries/typescript/lib/typescript';
import {CallExpression} from '../../../../libraries/typescript';
import {TypeChecker} from '../../entities/typescript';
import {Diagnostic} from '../../interfaces';
import {makeDiagnostic} from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/handlers/strict-assertion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CallExpression} from '../../../../libraries/typescript/lib/typescript';
import {CallExpression} from '../../../../libraries/typescript';
import {TypeChecker} from '../../entities/typescript';
import {Diagnostic} from '../../interfaces';
import {makeDiagnostic} from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion source/lib/assertions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CallExpression} from '../../../libraries/typescript/lib/typescript';
import {CallExpression} from '../../../libraries/typescript';
import {TypeChecker} from '../entities/typescript';
import {Diagnostic} from '../interfaces';
import {Handler, isIdentical, isNotIdentical, isNotAssignable, expectDeprecated, expectNotDeprecated} from './handlers';
Expand Down
2 changes: 1 addition & 1 deletion source/lib/entities/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TypeChecker as TSTypeChecker, Type} from '../../../libraries/typescript/lib/typescript';
import {TypeChecker as TSTypeChecker, Type} from '../../../libraries/typescript';

/**
* Custom interface for the TypeScript `TypeChecker` interface. This exports extra methods that we need
Expand Down
2 changes: 1 addition & 1 deletion source/lib/utils/make-diagnostic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Node} from '../../../libraries/typescript/lib/typescript';
import {Node} from '../../../libraries/typescript';
import {Diagnostic} from '../interfaces';

/**
Expand Down
2 changes: 1 addition & 1 deletion source/lib/utils/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TypeChecker, Expression, isCallLikeExpression, JSDocTagInfo} from '../../../libraries/typescript/lib/typescript';
import {TypeChecker, Expression, isCallLikeExpression, JSDocTagInfo} from '../../../libraries/typescript';

/**
* Resolve the JSDoc tags from the expression. If these tags couldn't be found, it will return `undefined`.
Expand Down