Skip to content

Commit

Permalink
chore: bump TypeScript version (#8591)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jun 23, 2019
1 parent f505454 commit 3f5a0e8
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 55 deletions.
12 changes: 5 additions & 7 deletions package.json
Expand Up @@ -15,8 +15,8 @@
"@types/babel__template": "^7.0.0",
"@types/jest": "24.0.2",
"@types/node": "*",
"@typescript-eslint/eslint-plugin": "^1.6.0",
"@typescript-eslint/parser": "^1.6.0",
"@typescript-eslint/eslint-plugin": "^1.10.2",
"@typescript-eslint/parser": "^1.10.2",
"ansi-regex": "^4.0.0",
"ansi-styles": "^3.2.0",
"babel-eslint": "^9.0.0",
Expand Down Expand Up @@ -49,6 +49,7 @@
"jest-junit": "^6.2.1",
"jest-silent-reporter": "^0.1.2",
"jest-snapshot-serializer-raw": "^1.1.0",
"jest-watch-typeahead": "^0.2.2-0",
"jquery": "^3.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "^2.1.1",
Expand All @@ -60,6 +61,7 @@
"mkdirp": "^0.5.1",
"mocha": "^6.0.2",
"mock-fs": "^4.4.1",
"opencollective": "^1.0.3",
"prettier": "^1.16.1",
"prettylint": "^1.0.0",
"progress": "^2.0.0",
Expand All @@ -71,7 +73,7 @@
"slash": "^2.0.0",
"string-length": "^2.0.0",
"strip-ansi": "^5.0.0",
"typescript": "^3.4.1",
"typescript": "^3.5.2",
"webpack": "^4.28.4"
},
"scripts": {
Expand Down Expand Up @@ -134,10 +136,6 @@
}
]
},
"dependencies": {
"jest-watch-typeahead": "^0.2.2-0",
"opencollective": "^1.0.3"
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-changed-files/src/index.ts
Expand Up @@ -52,7 +52,7 @@ export const getChangedFilesForRoots = async (
}

return allFiles;
}, new Set());
}, new Set<string>());

return {changedFiles, repos};
};
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/utils.ts
Expand Up @@ -250,7 +250,7 @@ const makeTestResults = (
let testResults: Circus.TestResults = [];
for (const test of describeBlock.tests) {
const testPath = [];
let parent: Circus.TestEntry | Circus.DescribeBlock = test;
let parent: Circus.TestEntry | Circus.DescribeBlock | undefined = test;
do {
testPath.unshift(parent.name);
} while ((parent = parent.parent));
Expand Down Expand Up @@ -298,7 +298,7 @@ const makeTestResults = (
// names + test title)
export const getTestID = (test: Circus.TestEntry) => {
const titles = [];
let parent: Circus.TestEntry | Circus.DescribeBlock = test;
let parent: Circus.TestEntry | Circus.DescribeBlock | undefined = test;
do {
titles.unshift(parent.name);
} while ((parent = parent.parent));
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/SearchSource.ts
Expand Up @@ -180,7 +180,7 @@ export default class SearchSource {

const allPathsAbsolute = Array.from(allPaths).map(p => path.resolve(p));

const collectCoverageFrom = new Set();
const collectCoverageFrom = new Set<string>();

testModulesMap.forEach(testModule => {
if (!testModule.dependencies) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/TestScheduler.ts
Expand Up @@ -73,7 +73,7 @@ export default class TestScheduler {
async scheduleTests(tests: Array<Test>, watcher: TestWatcher) {
const onStart = this._dispatcher.onTestStart.bind(this._dispatcher);
const timings: Array<number> = [];
const contexts = new Set();
const contexts = new Set<Context>();
tests.forEach(test => {
contexts.add(test.context);
if (test.duration) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/HasteFS.ts
Expand Up @@ -83,7 +83,7 @@ export default class HasteFS {
globs: Array<Config.Glob>,
root: Config.Path | null,
): Set<Config.Path> {
const files = new Set();
const files = new Set<string>();
for (const file of this.getAbsoluteFileIterator()) {
const filePath = root ? fastPath.relative(root, file) : file;
if (micromatch.some(replacePathSepForGlob(filePath), globs)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/lib/dependencyExtractor.ts
Expand Up @@ -75,7 +75,7 @@ const JEST_EXTENSIONS_RE = createRegExp(
);

export function extract(code: string): Set<string> {
const dependencies = new Set();
const dependencies = new Set<string>();

const addDependency = (match: string, _: string, dep: string) => {
dependencies.add(dep);
Expand Down
1 change: 1 addition & 0 deletions packages/jest-jasmine2/src/errorOnPrivate.ts
Expand Up @@ -53,6 +53,7 @@ export function installErrorOnPrivate(global: Global.Global): void {
(Object.keys(disabledJasmineMethods) as Array<
DisabledJasmineMethodsKeys
>).forEach(methodName => {
// @ts-ignore
jasmine[methodName] = () => {
throwAtFunction(disabledJasmineMethods[methodName], jasmine[methodName]);
};
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-mock/src/index.ts
Expand Up @@ -390,7 +390,7 @@ class ModuleMockerClass {
return [];
}

const slots = new Set();
const slots = new Set<string>();
const EnvObjectProto = this._environmentGlobal.Object.prototype;
const EnvFunctionProto = this._environmentGlobal.Function.prototype;
const EnvRegExpProto = this._environmentGlobal.RegExp.prototype;
Expand Down Expand Up @@ -1079,7 +1079,9 @@ class ModuleMockerClass {
);
}

// @ts-ignore: mock is assignable
descriptor[accessType] = this._makeComponent({type: 'function'}, () => {
// @ts-ignore: mock is assignable
descriptor![accessType] = original;
Object.defineProperty(obj, propertyName, descriptor!);
});
Expand Down
28 changes: 14 additions & 14 deletions packages/jest-types/src/Circus.ts
Expand Up @@ -69,15 +69,15 @@ export type Event =
}
| {
name: 'hook_success';
describeBlock: DescribeBlock | undefined | null;
test: TestEntry | undefined | null;
describeBlock?: DescribeBlock;
test?: TestEntry;
hook: Hook;
}
| {
name: 'hook_failure';
error: string | Exception;
describeBlock: DescribeBlock | undefined | null;
test: TestEntry | undefined | null;
describeBlock?: DescribeBlock;
test?: TestEntry;
hook: Hook;
}
| {
Expand Down Expand Up @@ -153,11 +153,11 @@ export type Event =

export type TestStatus = 'skip' | 'done' | 'todo';
export type TestResult = {
duration: number | null | undefined;
duration?: number | null;
errors: Array<FormattedError>;
invocations: number;
status: TestStatus;
location: {column: number; line: number} | null | undefined;
location?: {column: number; line: number} | null;
testPath: Array<TestName | BlockName>;
};

Expand All @@ -177,7 +177,7 @@ export type GlobalErrorHandlers = {

export type State = {
currentDescribeBlock: DescribeBlock;
currentlyRunningTest: TestEntry | undefined | null; // including when hooks are being executed
currentlyRunningTest?: TestEntry | null; // including when hooks are being executed
expand?: boolean; // expand error messages
hasFocusedTests: boolean; // that are defined using test.only
// Store process error handlers. During the run we inject our own
Expand All @@ -186,7 +186,7 @@ export type State = {
originalGlobalErrorHandlers?: GlobalErrorHandlers;
parentProcess: Process | null; // process object from the outer scope
rootDescribeBlock: DescribeBlock;
testNamePattern: RegExp | undefined | null;
testNamePattern?: RegExp | null;
testTimeout: number;
unhandledErrors: Array<Exception>;
includeTestLocationInResult: boolean;
Expand All @@ -197,7 +197,7 @@ export type DescribeBlock = {
hooks: Array<Hook>;
mode: BlockMode;
name: BlockName;
parent: DescribeBlock | undefined | null;
parent?: DescribeBlock;
tests: Array<TestEntry>;
};

Expand All @@ -206,13 +206,13 @@ export type TestError = Exception | Array<[Exception | undefined, Exception]>; /
export type TestEntry = {
asyncError: Exception; // Used if the test failure contains no usable stack trace
errors: TestError;
fn: TestFn | undefined | null;
fn?: TestFn;
invocations: number;
mode: TestMode;
name: TestName;
parent: DescribeBlock;
startedAt: number | undefined | null;
duration: number | undefined | null;
status: TestStatus | undefined | null; // whether the test has been skipped or run already
timeout: number | undefined | null;
startedAt?: number | null;
duration?: number | null;
status?: TestStatus | null; // whether the test has been skipped or run already
timeout?: number;
};
2 changes: 1 addition & 1 deletion packages/jest-util/src/deepCyclicCopy.ts
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

const EMPTY = new Set();
const EMPTY = new Set<string>();

export type DeepCyclicCopyOptions = {
blacklist?: Set<string>;
Expand Down
60 changes: 35 additions & 25 deletions yarn.lock
Expand Up @@ -1673,6 +1673,11 @@
resolved "https://registry.yarnpkg.com/@types/detect-newline/-/detect-newline-2.1.0.tgz#1896b5651b473792b6aba2500270fda626bc38d0"
integrity sha512-vcHS4yQkTfy+8QISuAFS+2SCjNcGs37+CWzxrrIOMv7yvPnYd6f1AeUErVEHVCu8dZreAHUqzV8RrjzeBorvtQ==

"@types/eslint-visitor-keys@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==

"@types/events@*":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
Expand Down Expand Up @@ -1975,29 +1980,39 @@
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0"
integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA==

"@typescript-eslint/eslint-plugin@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz#a5ff3128c692393fb16efa403ec7c8a5593dab0f"
integrity sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ==
"@typescript-eslint/eslint-plugin@^1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz#552fc64cfcb19c6162190360217c945e8faa330a"
integrity sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw==
dependencies:
"@typescript-eslint/parser" "1.6.0"
"@typescript-eslint/typescript-estree" "1.6.0"
requireindex "^1.2.0"
"@typescript-eslint/experimental-utils" "1.10.2"
eslint-utils "^1.3.1"
functional-red-black-tree "^1.0.1"
regexpp "^2.0.1"
tsutils "^3.7.0"

"@typescript-eslint/parser@1.6.0", "@typescript-eslint/parser@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804"
integrity sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw==
"@typescript-eslint/experimental-utils@1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz#cd548c03fc1a2b3ba5c136d1599001a1ede24215"
integrity sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg==
dependencies:
"@typescript-eslint/typescript-estree" "1.6.0"
"@typescript-eslint/typescript-estree" "1.10.2"
eslint-scope "^4.0.0"

"@typescript-eslint/parser@^1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.10.2.tgz#36cfe8c6bf1b6c1dd81da56f88c8588f4b1a852b"
integrity sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ==
dependencies:
"@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "1.10.2"
"@typescript-eslint/typescript-estree" "1.10.2"
eslint-visitor-keys "^1.0.0"

"@typescript-eslint/typescript-estree@1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0"
integrity sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA==
"@typescript-eslint/typescript-estree@1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz#8403585dd74b6cfb6f78aa98b6958de158b5897b"
integrity sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw==
dependencies:
lodash.unescape "4.0.1"
semver "5.5.0"
Expand Down Expand Up @@ -11379,11 +11394,6 @@ require-main-filename@^1.0.1:
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=

requireindex@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef"
integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==

requires-port@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
Expand Down Expand Up @@ -12815,10 +12825,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@*, typescript@^3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6"
integrity sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==
typescript@*, typescript@^3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c"
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==

ua-parser-js@^0.7.18:
version "0.7.19"
Expand Down

0 comments on commit 3f5a0e8

Please sign in to comment.