diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index 1e3e0918f8..0000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1,24 +0,0 @@ -- Issue - -[describe the issue here] - - - -- Expected behavior - -[describe the expected behavior here] - -- Output from your debug log -[ You can activate the debug logger by setting the environment variable TS_JEST_DEBUG="true" before running yarn test. The output of the logger -will be in **/node_modules/ts-jest/debug.txt** ] - - -- Link to a minimal repo that reproduces this issue - -[If you haven't already, create the smallest possible repo that reproduces this issue by running `npm install` and `npm test`. This will speed up any fixes that this issue might need] - - - -- Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo - -This allows potential solutions to be tested against the minimal repo. This saves everyone time and avoids a lot of back and forth. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..7d0de3f241 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,20 @@ + + +## Issue : + + +## Expected behavior : + + +## Output from debug log : +```bash +# content of debug.txt : + +``` + + +## Minimal repo : + + + diff --git a/COLLABORATORS.md b/COLLABORATORS.md index 5522f6aa44..58da020c47 100644 --- a/COLLABORATORS.md +++ b/COLLABORATORS.md @@ -1,11 +1,14 @@ -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* +**Table of Contents** - [Collaborator Guidelines](#collaborator-guidelines) - [Installing and building the project](#installing-and-building-the-project) - [Merging PRs](#merging-prs) - [Versioning](#versioning) + - [Tests](#tests) + - [How to add tests](#how-to-add-tests) + - [How to run tests](#how-to-run-tests) diff --git a/README.md b/README.md index 719200da1c..bba98092a7 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,11 @@ -# ts-jest +# ts-jest [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Greenkeeper badge](https://badges.greenkeeper.io/kulshekhar/ts-jest.svg)](https://greenkeeper.io/) [![Build Status for linux](https://travis-ci.org/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb/branch/master?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master) -[![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) -[![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) -[![Greenkeeper badge](https://badges.greenkeeper.io/kulshekhar/ts-jest.svg)](https://greenkeeper.io/) +**Important note**: Before reporting any issue, be sure to check the [troubleshooting page](https://github.com/kulshekhar/ts-jest/wiki/Troubleshooting). -[![Build Status for linux](https://travis-ci.org/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.org/kulshekhar/ts-jest) -[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb/branch/master?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master) - -**Important note: When using React 16 with Node version 8, you might see wrong line numbers for errors originating from tsx files. There's [an issue with more details on this](https://github.com/kulshekhar/ts-jest/issues/334)** > Note: Looking for collaborators. [Want to help improve ts-jest?](https://github.com/kulshekhar/ts-jest/issues/223) -ts-jest is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript. +**ts-jest** is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript. ## Table of Contents @@ -233,7 +227,7 @@ In some cases, projects may not want to have a `.babelrc` file, but still need t "globals": { "ts-jest": { "babelConfig": { - "presets": ["env"] + "presets": ["@babel/env"] } } } @@ -404,7 +398,6 @@ By default Jest ignores everything in `node_modules`. This setting prevents Jest ## Known Limitations ### Known limitations for TS compiler options - You can't use `"target": "ES6"` while using `node v4` in your test environment; -- You can't use `"jsx": "preserve"` for now (see [progress of this issue](https://github.com/kulshekhar/ts-jest/issues/63)); - If you use `"baseUrl": ""`, you also have to change `jest config` a little bit (also check [Module path mapping](#module-path-mapping) section): ```json "jest": { diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 206d91423f..0000000000 --- a/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as _install from './install'; -import * as preprocessor from './preprocessor'; - -interface TsJestModule { - install: typeof _install.install; - process: typeof preprocessor.process; - getCacheKey: typeof preprocessor.getCacheKey; -} - -declare const tsJestModule: TsJestModule; -export = tsJestModule; diff --git a/index.js b/index.js deleted file mode 100644 index 561337af94..0000000000 --- a/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// Avoid require()'ing the preprocessor when index.js gets loaded as part -// of the transpiled test file output, to avoid tripping this bug in -// babel-core: https://github.com/babel/babel/pull/6524 which is to be -// fixed in babel-core 7.0. -// Related ts-jest issue: https://github.com/kulshekhar/ts-jest/issues/367 -function lazyRequire(fnName) { - return function() { - return require('./dist/preprocessor')[fnName].apply(null, arguments); - }; -} - -module.exports = { - process: lazyRequire('process'), - getCacheKey: lazyRequire('getCacheKey'), -}; diff --git a/package.json b/package.json index 4cd0a26679..e9b0f9658c 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { "name": "ts-jest", "version": "23.0.1", - "main": "index.js", + "main": "dist/index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", "scripts": { - "build": "cpx index.d.ts dist/ && tsc -p .", - "build:watch": "cpx index.d.ts dist/ && tsc -p . -w", - "test:nolint": "npm run clean-build && node scripts/tests.js", - "clean": "rimraf dist/**/* && rimraf tests/simple/coverage && rimraf tests/simple-async/coverage && rimraf tests/**/*/debug.txt && rimraf tests/**/node_modules", + "build": "tsc -p tsconfig.build.json", + "build:watch": "tsc -p tsconfig.build.json -w", + "test:nolint": "npm run clean-build && jest --clearCache && node scripts/tests.js", + "clean": "rimraf dist/**/* && rimraf tests/*/coverage && rimraf tests/*/debug.txt && rimraf tests/*/node_modules", "clean-build": "npm run clean && npm run build", "pretest": "npm run tslint && npm run clean-build", "test": "node scripts/tests.js", - "tslint": "tslint src/*.ts", + "tslint": "tslint 'src/**/*.ts'", "doc": "doctoc .", "prepublish": "npm run clean-build", "precommit": "lint-staged", @@ -38,7 +38,7 @@ "homepage": "https://github.com/kulshekhar/ts-jest#readme", "jest": { "transform": { - "^.+\\.tsx?$": "/dist/preprocessor.js" + "^.+\\.tsx?$": "/dist/index.js" }, "testRegex": "tests/__tests__/.*\\.spec\\.ts$", "testPathIgnorePatterns": [ @@ -59,37 +59,45 @@ "js", "jsx", "json" - ] + ], + "globals": { + "ts-jest": { + "tsConfigFile": "tsconfig.base.json" + } + } }, "dependencies": { - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-jest": "^23.0.0", + "closest-file-data": "^0.1.4", "fs-extra": "6.0.1", "lodash": "^4.17.10" }, "peerDependencies": { - "babel-core": "^6.26.3 || ^7.0.0-0", + "babel-core": "^6.0.0 || ^7.0.0-0", + "babel-jest": "^23.0.0 || ^24.0.0", "jest": "^23.0.0 || ^24.0.0", "typescript": "^2.0.0 || ^3.0.0" }, "devDependencies": { - "@types/babel-core": "latest", + "@babel/core": "^7.0.0-beta.54", + "@babel/preset-env": "^7.0.0-beta.54", + "@types/babel-core": "^6.25.5", "@types/es6-shim": "0.31.37", "@types/fs-extra": "5.0.4", - "@types/jest": "^23.1.0", + "@types/jest": "^23.3.0", "@types/lodash": "^4.14.109", "@types/node": "10.5.5", "@types/react": "16.4.7", "@types/yargs": "^11.0.0", - "babel-core": "^6.26.3", - "babel-preset-env": "^1.7.0", + "babel-jest": "^23.4.0", + "babel-preset-jest": "^23.2.0", + "babel-core": "^7.0.0-0", "cpx": "^1.5.0", "cross-spawn": "latest", "cross-spawn-with-kill": "latest", "doctoc": "latest", "husky": "^0.14.3", - "jest": "^23.0.0", - "jest-config": "^23.0.0", + "jest": "^23.4.1", + "jest-config": "^23.4.1", "lint-staged": "^7.1.2", "pkg-dir": "^3.0.0", "prettier": "^1.12.1", @@ -97,9 +105,8 @@ "react-test-renderer": "16.4.2", "reflect-metadata": "^0.1.12", "rimraf": "^2.6.2", - "ts-jest": "23.0.0", - "tslint": "^5.10.0", - "typescript": "^2.8.3", + "tslint": "^5.11.0", + "typescript": "^2.9.2", "yargs": "^12.0.1" }, "lint-staged": { diff --git a/preprocessor.js b/preprocessor.js deleted file mode 100644 index d56eb74241..0000000000 --- a/preprocessor.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/preprocessor'); \ No newline at end of file diff --git a/scripts/tests.js b/scripts/tests.js index 3baec1dd28..a06cdf7bb3 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -13,11 +13,19 @@ function getDirectories(rootDir) { }); } +function isJestFolder(basename) { + return basename.startsWith('__') && basename.endsWith('__'); +} + +// TODO: later we could add a `.test-case-keep` empty file in each folder? +// ...or move all into a `test-cases` dedicated directory +function isTestCaseFolder(basename) { + return !isJestFolder(basename); +} + function createIntegrationMock() { const testsRoot = 'tests'; - const testCaseFolders = getDirectories(testsRoot).filter(function(testDir) { - return !(testDir.startsWith('__') && testDir.endsWith('__')); - }); + const testCaseFolders = getDirectories(testsRoot).filter(isTestCaseFolder); testCaseFolders.forEach(directory => { const testCaseNodeModules = path.join(testsRoot, directory, 'node_modules'); @@ -25,16 +33,6 @@ function createIntegrationMock() { const rootDir = path.resolve('.'); const testCaseModuleFolder = path.join(testCaseNodeModules, 'ts-jest'); - // Copy javascript files - fs.copySync( - path.resolve(rootDir, 'index.js'), - path.resolve(testCaseModuleFolder, 'index.js') - ); - fs.copySync( - path.resolve(rootDir, 'preprocessor.js'), - path.resolve(testCaseModuleFolder, 'preprocessor.js') - ); - // Copy package.json fs.copySync( path.resolve(rootDir, 'package.json'), diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000000..c9f1b96030 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,16 @@ +import getCacheKey from './utils/get-cache-key'; +import preprocess from './preprocess'; + +const createTransformer = (options?: any): jest.Transformer => { + // options are always empty, must be the older jest API giving options here + return { + canInstrument: true, + getCacheKey, + process: preprocess, + createTransformer: undefined as any, + }; +}; + +const mod = createTransformer(); +mod.createTransformer = createTransformer; +export = mod; diff --git a/src/jest-types.ts b/src/jest-types.ts deleted file mode 100644 index 350c75d311..0000000000 --- a/src/jest-types.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { TransformOptions as BabelTransformOpts } from 'babel-core'; - -export interface TransformOptions { - instrument: boolean; -} - -export type Path = string; - -export type Glob = string; - -export interface ConfigGlobals { - [key: string]: any; -} - -export interface HasteConfig { - defaultPlatform?: string | null; - hasteImplModulePath?: string; - platforms?: string[]; - providesModuleNodeModules: string[]; -} - -export interface BabelTransformOptions extends BabelTransformOpts { - cacheDirectory?: string; -} - -export type PostProcessHook = ( - codeSourcemapPair: CodeSourceMapPair, - filePath: string, - config: JestConfig, - transformOptions: TransformOptions, -) => CodeSourceMapPair; - -export type JestConfig = Partial; - -export interface FullJestProjectConfig { - automock: boolean; - browser: boolean; - cache: boolean; - cacheDirectory: Path; - clearMocks: boolean; - coveragePathIgnorePatterns: string[]; - cwd: Path; - detectLeaks: boolean; - detectOpenHandles: boolean; - displayName: string | null; - errorOnDeprecated: boolean; - filter: Path | null; - forceCoverageMatch: Glob[]; - globals: ConfigGlobals; - haste: HasteConfig; - moduleDirectories: string[]; - moduleFileExtensions: string[]; - moduleLoader: Path; - moduleNameMapper: Array<[string, string]>; - modulePathIgnorePatterns: string[]; - modulePaths: string[]; - name: string; - resetMocks: boolean; - resetModules: boolean; - resolver: Path | null; - restoreMocks: boolean; - rootDir: Path; - roots: Path[]; - runner: string; - setupFiles: Path[]; - setupTestFrameworkScriptFile: Path | null; - skipFilter: boolean; - skipNodeResolution: boolean; - snapshotSerializers: Path[]; - testEnvironment: string; - testEnvironmentOptions: object; - testLocationInResults: boolean; - testMatch: Glob[]; - testPathIgnorePatterns: string[]; - testRegex: string; - testRunner: string; - testURL: string; - timers: 'real' | 'fake'; - transform: Array<[string, Path]>; - transformIgnorePatterns: Glob[]; - watchPathIgnorePatterns: string[]; - unmockedModulePathPatterns: string[] | null; -} - -export interface TsJestConfig { - skipBabel?: boolean; - useBabelrc?: boolean; - babelConfig?: BabelTransformOpts; - tsConfigFile?: string; - enableInternalCache?: boolean; - enableTsDiagnostics?: boolean; - disableSourceMapSupport?: boolean; - ignoreCoverageForDecorators?: boolean; - ignoreCoverageForAllDecorators?: boolean; - useExperimentalLanguageServer?: boolean; -} - -export interface JestConfigNormalize { - hasDeprecationWarnings: boolean; - options: FullJestProjectConfig; -} - -export interface CodeSourceMapPair { - code: string; - map: string; -} diff --git a/src/postprocess.ts b/src/postprocess.ts index 181e99d220..4ead6c3195 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -5,45 +5,34 @@ import * as __types__babel from 'babel-core'; import __types__istanbulPlugin from 'babel-plugin-istanbul'; import * as __types__jestPreset from 'babel-preset-jest'; -import * as ts from 'typescript'; +import { + BabelTransformOptions, + PostProcessHook, + JestCacheKeyOptions, +} from './types'; +import { logOnce } from './utils/logger'; +import getTSJestConfig from './utils/get-ts-jest-config'; + let babel: typeof __types__babel; let istanbulPlugin: typeof __types__istanbulPlugin; let jestPreset: typeof __types__jestPreset; + function importBabelDeps() { - if (babel) { - return; - } - babel = require('babel-core'); + if (babel) return; // tslint:disable-line + // we must use babel until we handle hoisting of jest.mock() internally + babel = require('@babel/core'); istanbulPlugin = require('babel-plugin-istanbul').default; jestPreset = require('babel-preset-jest'); } -import { CompilerOptions } from 'typescript/lib/typescript'; -import { - BabelTransformOptions, - CodeSourceMapPair, - FullJestProjectConfig, - JestConfig, - PostProcessHook, - TransformOptions, - TsJestConfig, -} from './jest-types'; -import { logOnce } from './logger'; -import { BabelFileResult } from 'babel-core'; // Function that takes the transpiled typescript and runs it through babel/whatever. export function postProcessCode( - compilerOptions: CompilerOptions, - jestConfig: JestConfig, - tsJestConfig: TsJestConfig, - transformOptions: TransformOptions, - transpileOutput: CodeSourceMapPair, + jestConfig: jest.ProjectConfig, + transformOptions: jest.TransformOptions, + transpileOutput: jest.TransformedSource, filePath: string, -): CodeSourceMapPair { - const postHook = getPostProcessHook( - compilerOptions, - jestConfig, - tsJestConfig, - ); +): jest.TransformedSource { + const postHook = getPostProcessHook(jestConfig); return postHook(transpileOutput, filePath, jestConfig, transformOptions); } @@ -52,70 +41,96 @@ function createBabelTransformer( options: BabelTransformOptions, ): PostProcessHook { importBabelDeps(); - options = { - ...options, - plugins: options.plugins || [], - presets: (options.presets || []).concat([jestPreset]), - }; - delete options.cacheDirectory; - delete options.filename; + const presets = options.presets.slice(); + const plugins = options.plugins.slice(); + + // adds babel-preset-jest if not present + if (!hasBabelAddon(presets, jestPreset)) { + presets.push(jestPreset); + } - return ( - codeSourcemapPair: CodeSourceMapPair, + // we need to know if there is istanbul plugin in the list so that we do not add it + // in the case the user already has it configured + const hasIstanbul = hasBabelAddon(plugins, istanbulPlugin); + + // create a new object we'll use as options with the sliced presets and plugins + const optionsBase = { ...options, presets, plugins }; + + delete optionsBase.cacheDirectory; + + const babelTransformer = ( + codeSourcemapPair: jest.TransformedSource, filename: string, - config: JestConfig, - transformOptions: TransformOptions, - ): CodeSourceMapPair => { - const theseOptions = Object.assign( - { filename, inputSourceMap: codeSourcemapPair.map }, - options, - ); + config: jest.ProjectConfig, + transformOptions: JestCacheKeyOptions, + ): jest.TransformedSource => { + const inputSourceMap = + typeof codeSourcemapPair.map === 'string' + ? JSON.parse(codeSourcemapPair.map) + : codeSourcemapPair.map; + const theseOptions = { ...optionsBase, filename, inputSourceMap }; if (transformOptions && transformOptions.instrument) { theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - istanbulPlugin, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); + if (!hasIstanbul) { + theseOptions.plugins = [ + ...theseOptions.plugins, + istanbulPluginConfig(config), + ]; + } } - // Babel has incorrect typings, where the map is an object instead of a string. So we have to typecast it here - return (babel.transform( + + // we typecast here because babel returns a more complete object than the one expected by jest + return babel.transform( codeSourcemapPair.code, theseOptions, - ) as any) as CodeSourceMapPair; + ) as jest.TransformedSource; }; + + return babelTransformer; } export const getPostProcessHook = ( - tsCompilerOptions: CompilerOptions, - jestConfig: JestConfig, - tsJestConfig: TsJestConfig, + jestConfig: jest.ProjectConfig, ): PostProcessHook => { + const tsJestConfig = getTSJestConfig(jestConfig); if (tsJestConfig.skipBabel) { logOnce('Not using any postprocess hook.'); // Identity function return input => input; } - const plugins = Array.from( - (tsJestConfig.babelConfig && tsJestConfig.babelConfig.plugins) || [], - ); - + const tsJestBabelConfig = tsJestConfig.babelConfig || {}; const babelOptions: BabelTransformOptions = { - ...tsJestConfig.babelConfig, + ...tsJestBabelConfig, babelrc: tsJestConfig.useBabelrc || false, - plugins, - presets: tsJestConfig.babelConfig ? tsJestConfig.babelConfig.presets : [], - sourceMaps: tsJestConfig.disableSourceMapSupport !== true, + plugins: toArray(tsJestBabelConfig.plugins), + presets: toArray(tsJestBabelConfig.presets), + sourceMaps: tsJestConfig.disableSourceMapSupport ? false : 'both', }; logOnce('Using babel with options:', babelOptions); return createBabelTransformer(babelOptions); }; + +function toArray(iter?: Iterable | null): T[] { + return iter ? Array.from(iter) : []; +} + +function istanbulPluginConfig(jestConfig: jest.ProjectConfig) { + return [ + istanbulPlugin, + { + // files outside `cwd` will not be instrumented + cwd: jestConfig.rootDir, + exclude: [], + }, + ]; +} + +function hasBabelAddon(inputList: any[], ...addonMatches: any[]): boolean { + return inputList.some(item => { + return addonMatches.indexOf(Array.isArray(item) ? item[0] : item) !== -1; + }); +} diff --git a/src/preprocessor.ts b/src/preprocess.ts similarity index 52% rename from src/preprocessor.ts rename to src/preprocess.ts index 851563e4d6..064e901001 100644 --- a/src/preprocessor.ts +++ b/src/preprocess.ts @@ -1,25 +1,19 @@ -import * as crypto from 'crypto'; -import { - BabelTransformOptions, - CodeSourceMapPair, - JestConfig, - Path, - TransformOptions, -} from './jest-types'; -import { flushLogs, logOnce } from './logger'; +import { flushLogs, logOnce } from './utils/logger'; import { postProcessCode } from './postprocess'; -import { getTSConfig, getTSJestConfig, runTsDiagnostics } from './utils'; import { transpileTypescript } from './transpiler'; +import runTsDiagnostics from './utils/run-ts-diagnostics'; +import getTSConfig from './utils/get-ts-config'; +import getTSJestConfig from './utils/get-ts-jest-config'; -export function process( +export default function preprocess( src: string, - filePath: Path, - jestConfig: JestConfig, - transformOptions: TransformOptions = { instrument: false }, -): CodeSourceMapPair | string { + filePath: jest.Path, + jestConfig: jest.ProjectConfig, + transformOptions?: jest.TransformOptions, +): jest.TransformedSource | string { // transformOptions.instrument is a proxy for collectCoverage // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 - const compilerOptions = getTSConfig(jestConfig.globals, jestConfig.rootDir); + const compilerOptions = getTSConfig(jestConfig); logOnce('final compilerOptions:', compilerOptions); @@ -28,8 +22,12 @@ export function process( const isHtmlFile = /\.html$/.test(filePath); // This is to support angular 2. See https://github.com/kulshekhar/ts-jest/pull/145 - if (isHtmlFile && jestConfig.globals.__TRANSFORM_HTML__) { - src = 'module.exports=`' + src + '`;'; + if ( + isHtmlFile && + jestConfig.globals && + (jestConfig.globals as any).__TRANSFORM_HTML__ + ) { + src = 'module.exports=' + JSON.stringify(src) + ';'; } const processFile = @@ -39,7 +37,7 @@ export function process( return src; } - const tsJestConfig = getTSJestConfig(jestConfig.globals); + const tsJestConfig = getTSJestConfig(jestConfig); logOnce('tsJestConfig: ', tsJestConfig); // We can potentially do this faster by using the language service. @@ -50,23 +48,22 @@ export function process( const transpileOutput = transpileTypescript(filePath, src, compilerOptions); + // FIXME: this should be done in the typescript source, else it's invalidating source maps if (tsJestConfig.ignoreCoverageForAllDecorators === true) { transpileOutput.code = transpileOutput.code.replace( - /__decorate/g, + /\b__decorate\b/g, '/* istanbul ignore next */__decorate', ); } if (tsJestConfig.ignoreCoverageForDecorators === true) { transpileOutput.code = transpileOutput.code.replace( - /(__decorate\(\[\r?\n[^\n\r]*)\/\*\s*istanbul\s*ignore\s*decorator(.*)\*\//g, + /(\b__decorate\(\[\r?\n[^\n\r]*)\/\*\s*istanbul\s+ignore\s+decorator(.*)\*\//g, '/* istanbul ignore next$2*/$1', ); } const outputText = postProcessCode( - compilerOptions, jestConfig, - tsJestConfig, transformOptions, transpileOutput, filePath, @@ -76,24 +73,3 @@ export function process( return { code: outputText.code, map: outputText.map }; } - -/** - * This is the function Jest uses to check if it has the file already in cache - */ -export function getCacheKey( - fileData: string, - filePath: Path, - jestConfigStr: string, - transformOptions: TransformOptions = { instrument: false }, -): string { - const jestConfig: JestConfig = JSON.parse(jestConfigStr); - - const tsConfig = getTSConfig(jestConfig.globals, jestConfig.rootDir); - - return crypto - .createHash('md5') - .update(JSON.stringify(tsConfig), 'utf8') - .update(JSON.stringify(transformOptions), 'utf8') - .update(fileData + filePath + jestConfigStr, 'utf8') - .digest('hex'); -} diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts deleted file mode 100644 index 95a2640f0e..0000000000 --- a/src/transpile-if-ts.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as tsc from 'typescript'; -import { getTSConfig, mockGlobalTSConfigSchema } from './utils'; -import { ConfigGlobals } from './jest-types'; - -export function transpileIfTypescript( - path: string, - contents: string, - config?: ConfigGlobals, - rootDir: string = '', -): string { - if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { - const transpiled = tsc.transpileModule(contents, { - compilerOptions: getTSConfig( - config || mockGlobalTSConfigSchema(global), - rootDir, - ), - fileName: path, - }); - - return transpiled.outputText; - } - return contents; -} diff --git a/src/transpiler.ts b/src/transpiler.ts index e6b1247d5f..9e17459111 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -1,25 +1,19 @@ -import * as fs from 'fs'; -import { cwd } from 'process'; import * as ts from 'typescript'; -import { logOnce } from './logger'; -import { CodeSourceMapPair, TsJestConfig } from './jest-types'; +import { logOnce } from './utils/logger'; // Takes the typescript code and by whatever method configured, makes it into javascript code. export function transpileTypescript( filePath: string, fileSrc: string, compilerOptions: ts.CompilerOptions, -): CodeSourceMapPair { +): jest.TransformedSource { logOnce('Compiling via normal transpileModule call'); - const transpileOutput = transpileViaTranspileModule( + const { outputText: code, sourceMapText: map } = transpileViaTranspileModule( filePath, fileSrc, compilerOptions, ); - return { - code: transpileOutput.outputText, - map: transpileOutput.sourceMapText, - }; + return { code, map }; } /** @@ -35,7 +29,7 @@ function transpileViaTranspileModule( fileName: filePath, reportDiagnostics: true, }); - const {diagnostics} = transpileOutput; + const { diagnostics } = transpileOutput; if (diagnostics.length > 0) { const errors = formatDiagnostics(diagnostics); @@ -53,9 +47,9 @@ function formatDiagnostics(diagnostics: ts.Diagnostic[]): string { } function createTranspilationError(errors: string): Error { - return Error( - `TypeScript compiler encountered syntax errors while transpiling. Errors: ${errors}`, - ); + return Error( + `TypeScript compiler encountered syntax errors while transpiling. Errors: ${errors}`, + ); } function logMessageForTranspilationErrors(errors: string): string { diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000000..5e65556867 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,47 @@ +import { TransformOptions as BabelTransformOpts } from 'babel-core'; + +export interface JestCacheKeyOptions { + rootDir: string; + instrument: boolean; +} + +export interface TsJestContext { + cache: any; + options: any; +} + +export interface HasteConfig { + defaultPlatform?: string | null; + hasteImplModulePath?: string; + platforms?: string[]; + providesModuleNodeModules: string[]; +} + +export interface BabelTransformOptions extends BabelTransformOpts { + cacheDirectory?: string; +} + +export type PostProcessHook = ( + codeSourcemapPair: jest.TransformedSource, + filePath: string, + config: jest.ProjectConfig, + transformOptions: jest.TransformOptions, +) => jest.TransformedSource; + +export interface TsJestConfig { + babelConfig?: BabelTransformOpts; + disableSourceMapSupport?: boolean; + enableInternalCache?: boolean; + enableTsDiagnostics?: boolean; + ignoreCoverageForAllDecorators?: boolean; + ignoreCoverageForDecorators?: boolean; + skipBabel?: boolean; + tsConfigFile?: string; + useBabelrc?: boolean; + useExperimentalLanguageServer?: boolean; +} + +export interface JestConfigNormalize { + hasDeprecationWarnings: boolean; + options: jest.DefaultOptions; +} diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index 8b9b03c198..0000000000 --- a/src/utils.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as crypto from 'crypto'; -import * as fs from 'fs'; -import * as fsExtra from 'fs-extra'; -import * as path from 'path'; -import * as tsc from 'typescript'; -import { ConfigGlobals, JestConfig, TsJestConfig } from './jest-types'; -import { logOnce } from './logger'; -import * as _ from 'lodash'; - -export function getTSJestConfig(globals: ConfigGlobals): TsJestConfig { - return globals && globals['ts-jest'] ? globals['ts-jest'] : {}; -} - -function formatTsDiagnostics(errors: tsc.Diagnostic[]): string { - const defaultFormatHost: tsc.FormatDiagnosticsHost = { - getCurrentDirectory: () => tsc.sys.getCurrentDirectory(), - getCanonicalFileName: fileName => fileName, - getNewLine: () => tsc.sys.newLine, - }; - - return tsc.formatDiagnostics(errors, defaultFormatHost); -} - -function readCompilerOptions( - configPath: string, - rootDir: string, -): tsc.CompilerOptions { - configPath = path.resolve(rootDir, configPath); - const { config, error } = tsc.readConfigFile(configPath, tsc.sys.readFile); - if (error) { - throw error; - } - - const { errors, options } = tsc.parseJsonConfigFileContent( - config, - tsc.sys, - path.resolve(rootDir), - ); - - if (errors.length > 0) { - const formattedErrors = formatTsDiagnostics(errors); - throw new Error( - `Some errors occurred while attempting to read from ${configPath}: ${formattedErrors}`, - ); - } - - return options; -} - -function getStartDir(): string { - // This is needed because of the way our tests are structured. - // If this is being executed as a library (under node_modules) - // we want to start with the project directory that's three - // levels above. - // If this is being executed from the test suite, we want to start - // in the directory of the test - - const grandparent = path.resolve(__dirname, '..', '..'); - if (grandparent.endsWith(`${path.sep}node_modules`)) { - return process.cwd(); - } - - return '.'; -} - -function getPathToClosestTSConfig( - startDir?: string, - previousDir?: string, -): string { - // Starting with the startDir directory and moving on to the - // parent directory recursively (going no further than the root directory) - // find and return the path to the first encountered tsconfig.json file - - if (!startDir) { - return getPathToClosestTSConfig(getStartDir()); - } - - const tsConfigPath = path.join(startDir, 'tsconfig.json'); - - const startDirPath = path.resolve(startDir); - const previousDirPath = path.resolve(previousDir || '/'); - - if (startDirPath === previousDirPath || fs.existsSync(tsConfigPath)) { - return tsConfigPath; - } - - return getPathToClosestTSConfig(path.join(startDir, '..'), startDir); -} - -function getTSConfigPathFromConfig( - globals: ConfigGlobals, - rootDir?: string, -): string { - const defaultTSConfigFile = getPathToClosestTSConfig(rootDir); - if (!globals) { - return defaultTSConfigFile; - } - - const tsJestConfig = getTSJestConfig(globals); - - if (tsJestConfig.tsConfigFile) { - return tsJestConfig.tsConfigFile; - } - - return defaultTSConfigFile; -} - -export function mockGlobalTSConfigSchema( - globals: ConfigGlobals, -): ConfigGlobals { - const configPath = getTSConfigPathFromConfig(globals); - return { 'ts-jest': { tsConfigFile: configPath } }; -} - -export const getTSConfig = _.memoize(getTSConfig_local, (globals, rootDir) => { - // check cache before resolving configuration - // NB: We use JSON.stringify() to create a consistent, unique signature. Although it lacks a uniform - // shape, this is simpler and faster than using the crypto package to generate a hash signature. - return `${rootDir}:${JSON.stringify(globals)}`; -}); - -// Non-memoized version of TSConfig -function getTSConfig_local(globals, rootDir: string = '') { - const configPath = getTSConfigPathFromConfig(globals, rootDir); - logOnce(`Reading tsconfig file from path ${configPath}`); - - const config = readCompilerOptions(configPath, rootDir); - logOnce('Original typescript config before modifications: ', { ...config }); - - // tsc should not emit declaration map when used for tests - // disable some options that might break jest - config.declaration = false; - config.declarationMap = false; - config.emitDeclarationOnly = false; - - // ts-jest will map lines numbers properly if inlineSourceMap and - // inlineSources are set to true. The sourceMap configuration - // is used to send the sourcemap back to Jest - delete config.sourceMap; - config.inlineSourceMap = true; - config.inlineSources = true; - - // the coverage report is broken if `.outDir` is set - // see https://github.com/kulshekhar/ts-jest/issues/201 - // `.outDir` is removed even for test files as it affects with breakpoints - // see https://github.com/kulshekhar/ts-jest/issues/309 - delete config.outDir; - - if (configPath === path.join(getStartDir(), 'tsconfig.json')) { - // hardcode module to 'commonjs' in case the config is being loaded - // from the default tsconfig file. This is to ensure that coverage - // works well. If there's a need to override, it can be done using - // a custom tsconfig for testing - config.module = tsc.ModuleKind.CommonJS; - } - - config.module = config.module || tsc.ModuleKind.CommonJS; - config.jsx = config.jsx || tsc.JsxEmit.React; - - return config; -} - -export function cacheFile( - jestConfig: JestConfig, - filePath: string, - src: string, -): void { - // store transpiled code contains source map into cache, except test cases - if (!jestConfig.testRegex || !filePath.match(jestConfig.testRegex)) { - const outputFilePath = path.join( - jestConfig.cacheDirectory, - '/ts-jest/', - crypto - .createHash('md5') - .update(filePath) - .digest('hex'), - ); - - fsExtra.outputFileSync(outputFilePath, src); - } -} - -export function runTsDiagnostics( - filePath: string, - compilerOptions: tsc.CompilerOptions, -): void { - const program = tsc.createProgram([filePath], compilerOptions); - const allDiagnostics = tsc.getPreEmitDiagnostics(program); - - if (allDiagnostics.length) { - throw new Error(formatTsDiagnostics(allDiagnostics)); - } -} diff --git a/src/utils/cache-file.ts b/src/utils/cache-file.ts new file mode 100644 index 0000000000..ae2de1eb49 --- /dev/null +++ b/src/utils/cache-file.ts @@ -0,0 +1,38 @@ +import { join } from 'path'; +import { createHash } from 'crypto'; +import { outputFileSync } from 'fs-extra'; +import { memoize } from 'lodash'; + +// to use the same compiled regexp object all the time +// See https://jsperf.com/string-match-str-re/1 +const memoizedRegexp = memoize(RegExp); +const cachedTest = ( + reString: string | undefined | null, + subject: string, +): boolean => { + if (reString == null) { + return false; + } + return memoizedRegexp(reString).test(subject); +}; + +const cachedMd5 = memoize((path: string) => + createHash('md5') + .update(path) + .digest('hex'), +); + +// FIXME: I think there is testRegexp and testMatch in Jest configugation +// There is a default setting for that, but maybe it's defaulted from scratch +export function cacheFile( + jestConfig: jest.ProjectConfig, + filePath: string, + src: string, +): void { + // store transpiled code contains source map into cache, except test cases + if (!cachedTest(jestConfig.testRegex, filePath)) { + const hash = cachedMd5(filePath); + const outputFilePath = join(jestConfig.cacheDirectory, 'ts-jest', hash); + outputFileSync(outputFilePath, src); + } +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 0000000000..675384cd92 --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1,13 @@ +import { readFileSync } from 'fs'; +import { resolve } from 'path'; + +export const BABELRC_FILENAME = '.babelrc'; +export const BABELRC_JS_FILENAME = '.babelrc.js'; +export const BABEL_CONFIG_KEY = 'babel'; +export const TSCONFIG_FILENAME = 'tsconfig.json'; +export const TSCONFIG_GLOBALS_KEY = 'ts-jest'; +export const PACKAGE_JSON = 'package.json'; +export const MY_PACKAGE_CONTENT = readFileSync( + resolve(__dirname, '..', '..', PACKAGE_JSON), + 'utf8', +); diff --git a/src/utils/format-diagnostics.ts b/src/utils/format-diagnostics.ts new file mode 100644 index 0000000000..e6911fb6f7 --- /dev/null +++ b/src/utils/format-diagnostics.ts @@ -0,0 +1,16 @@ +import { + sys, + Diagnostic, + FormatDiagnosticsHost, + formatDiagnostics, +} from 'typescript'; + +export default function formatTsDiagnostics(errors: Diagnostic[]): string { + const defaultFormatHost: FormatDiagnosticsHost = { + getCurrentDirectory: () => sys.getCurrentDirectory(), + getCanonicalFileName: fileName => fileName, + getNewLine: () => sys.newLine, + }; + + return formatDiagnostics(errors, defaultFormatHost); +} diff --git a/src/utils/get-babel-rc.ts b/src/utils/get-babel-rc.ts new file mode 100644 index 0000000000..0e7b665102 --- /dev/null +++ b/src/utils/get-babel-rc.ts @@ -0,0 +1,22 @@ +import closestFileData from 'closest-file-data'; +import { readFileSync } from 'fs'; +import { + BABELRC_FILENAME, + BABELRC_JS_FILENAME, + PACKAGE_JSON, + BABEL_CONFIG_KEY, +} from './constants'; + +const babelReaders = [ + { + basename: BABELRC_FILENAME, + read: f => JSON.parse(readFileSync(f, 'utf8')), + }, + { basename: BABELRC_JS_FILENAME, read: f => require(f) }, + { basename: PACKAGE_JSON, read: f => require(f)[BABEL_CONFIG_KEY] }, +]; + +export default function getBabelRC(filename): babel.BabylonOptions | void { + const res = closestFileData(filename, babelReaders); + return res && res.data; +} diff --git a/src/utils/get-cache-key.ts b/src/utils/get-cache-key.ts new file mode 100644 index 0000000000..f213e31923 --- /dev/null +++ b/src/utils/get-cache-key.ts @@ -0,0 +1,26 @@ +import { JestCacheKeyOptions } from '../types'; +import { relative } from 'path'; +import { MY_PACKAGE_CONTENT } from './constants'; +import getBabelRC from './get-babel-rc'; +import getTSConfig from './get-ts-config'; + +export default function getCacheKey( + fileData: string, + filePath: string, + jestConfigString: string, + { instrument, rootDir }: JestCacheKeyOptions, +): string { + const jestConfig: jest.ProjectConfig = JSON.parse(jestConfigString) || {}; + delete jestConfig.cacheDirectory; + delete jestConfig.name; + // jest creates hash under the hoods + return JSON.stringify([ + MY_PACKAGE_CONTENT, + fileData, + relative(rootDir, filePath), + jestConfig, + getTSConfig(jestConfig), + getBabelRC(filePath), + instrument, + ]); +} diff --git a/src/utils/get-ts-config.ts b/src/utils/get-ts-config.ts new file mode 100644 index 0000000000..6c018303ed --- /dev/null +++ b/src/utils/get-ts-config.ts @@ -0,0 +1,131 @@ +import { TSCONFIG_FILENAME } from './constants'; +import { + CompilerOptions, + readConfigFile, + sys, + parseJsonConfigFileContent, + ModuleKind, + JsxEmit, +} from 'typescript'; +import { resolve, sep, dirname } from 'path'; +import { existsSync } from 'fs'; +import formatTsDiagnostics from './format-diagnostics'; +import closestFileData from 'closest-file-data'; +import { memoize } from 'lodash'; +import { logOnce } from './logger'; +import getTSJestConfig from './get-ts-jest-config'; + +const getTSConfig = memoize(getTSConfig_local, jestConfig => { + // check cache before resolving configuration + // NB: We use JSON.stringify() to create a consistent, unique signature. Although it lacks a uniform + // shape, this is simpler and faster than using the crypto package to generate a hash signature. + return JSON.stringify({ ...jestConfig, name: null, cacheDirectory: null }); +}); +export default getTSConfig; + +// Non-memoized version of TSConfig +function getTSConfig_local(jestConfig: jest.ProjectConfig): CompilerOptions { + const configMeta = findTSConfigPath(jestConfig); + if (!configMeta) { + throw new ReferenceError( + `[ts-jest] Unable to find TS configuration file given current configuration`, + ); + } + const { path: configPath } = configMeta; + logOnce(`Reading tsconfig file from path ${configPath}`); + + const config = readCompilerOptions(configPath); + logOnce('Original typescript config before modifications: ', { ...config }); + + // tsc should not emit declaration map when used for tests + // disable some options that might break jest + config.declaration = false; + config.declarationMap = false; + config.emitDeclarationOnly = false; + + // ts-jest will map lines numbers properly if inlineSourceMap and + // inlineSources are set to true. The sourceMap configuration + // is used to send the sourcemap back to Jest + config.inlineSourceMap = false; + config.sourceMap = true; + config.inlineSources = true; + + // the coverage report is broken if `.outDir` is set + // see https://github.com/kulshekhar/ts-jest/issues/201 + // `.outDir` is removed even for test files as it affects with breakpoints + // see https://github.com/kulshekhar/ts-jest/issues/309 + delete config.outDir; + delete config.outFile; + + if (!configMeta.isUserDefined) { + // hardcode module to 'commonjs' in case the config is being loaded + // from the default tsconfig file. This is to ensure that coverage + // works well. If there's a need to override, it can be done using + // a custom tsconfig for testing + config.module = ModuleKind.CommonJS; + } + + config.module = config.module || ModuleKind.CommonJS; + config.jsx = config.jsx || JsxEmit.React; + + return config; +} + +function readCompilerOptions(configPath: string): CompilerOptions { + // at this point the configPath is resolved + const { config, error } = readConfigFile(configPath, sys.readFile); + if (error) { + throw error; + } + + const { errors, options } = parseJsonConfigFileContent( + config, + sys, + // paths in a tsconfig are relative to that file's path + dirname(configPath), + ); + + if (errors.length > 0) { + const formattedErrors = formatTsDiagnostics(errors); + throw new Error( + `Some errors occurred while attempting to read from ${configPath}: ${formattedErrors}`, + ); + } + + return options; +} + +// we don't need any data, just its full path +const tsConfigReader = { basename: TSCONFIG_FILENAME, read: () => 0 }; + +function findTSConfigPath( + jestConfig: jest.ProjectConfig, +): { isUserDefined?: boolean; path: string } | void { + let tsConfigFile = getTSJestConfig(jestConfig).tsConfigFile; + if (tsConfigFile) { + const givenConfigFile = tsConfigFile; + tsConfigFile = tsConfigFile.replace( + '', + `${jestConfig.rootDir}${sep}`, + ); + // ensure the path is resolved + if (!tsConfigFile.startsWith('/')) { + tsConfigFile = resolve(jestConfig.rootDir, tsConfigFile); + } else { + tsConfigFile = resolve(tsConfigFile); + } + if (!existsSync(tsConfigFile)) { + throw new Error( + [ + `Unable to find tsconfig file given "${givenConfigFile}". If you gave a relative path,`, + `it'll be relative to the resolved "rootDir".\nTo avoid issues, use followed`, + `by a relative path to it in "tsConfigFile" config key.`, + ].join(' '), + ); + } + return { path: tsConfigFile, isUserDefined: true }; + } + + // try to find the config file starting from the root dir as defined in (or resolved by) jest config + return closestFileData(jestConfig.rootDir, tsConfigReader); +} diff --git a/src/utils/get-ts-jest-config.ts b/src/utils/get-ts-jest-config.ts new file mode 100644 index 0000000000..9cf5736c95 --- /dev/null +++ b/src/utils/get-ts-jest-config.ts @@ -0,0 +1,8 @@ +import { TSCONFIG_GLOBALS_KEY } from './constants'; +import { TsJestConfig } from '../types'; + +export default function getTSJestConfig( + jestConfig: jest.ProjectConfig | jest.InitialOptions, +): TsJestConfig { + return (jestConfig.globals && jestConfig.globals[TSCONFIG_GLOBALS_KEY]) || {}; +} diff --git a/src/logger.ts b/src/utils/logger.ts similarity index 96% rename from src/logger.ts rename to src/utils/logger.ts index 094d64ee88..b7f44876a0 100644 --- a/src/logger.ts +++ b/src/utils/logger.ts @@ -31,7 +31,7 @@ export function flushLogs(): void { return; // only output stuff for the first invocation and if logging is enabled. } logsFlushed = true; - const rootPath = path.resolve(__dirname, '../'); + const rootPath = path.resolve(__dirname, '..', '..'); const JSONifiedLogs = logs.map(convertToJSONIfPossible); const logString = JSONifiedLogs.join('\n'); const filePath = path.resolve(rootPath, 'debug.txt'); diff --git a/src/utils/run-ts-diagnostics.ts b/src/utils/run-ts-diagnostics.ts new file mode 100644 index 0000000000..856179b6d9 --- /dev/null +++ b/src/utils/run-ts-diagnostics.ts @@ -0,0 +1,18 @@ +import formatTsDiagnostics from './format-diagnostics'; +import { + getPreEmitDiagnostics, + createProgram, + CompilerOptions, +} from 'typescript'; + +export default function runTsDiagnostics( + filePath: string, + compilerOptions: CompilerOptions, +): void { + const program = createProgram([filePath], compilerOptions); + const allDiagnostics = getPreEmitDiagnostics(program); + + if (allDiagnostics.length) { + throw new Error(formatTsDiagnostics(allDiagnostics)); + } +} diff --git a/tests/__helpers__/mock-jest-config.ts b/tests/__helpers__/mock-jest-config.ts new file mode 100644 index 0000000000..8981a549ad --- /dev/null +++ b/tests/__helpers__/mock-jest-config.ts @@ -0,0 +1,26 @@ +import { TsJestConfig } from '../../dist/types'; + +const { resolve } = require.requireActual('path'); + +/** + * Mock a jest config object for the test case in given folder + * + * Basically it defines `rootDir` and `cwd` properties to the full path of that + * test case, as Jest would do. + * + * Accepts an optional config object, which will be defined on `globals.ts-jest` + */ +export default function mockJestConfig( + testCaseFolder: string, + tsJest: TsJestConfig | null = null, +): jest.ProjectConfig { + // resolves the path since jest would give a resolved path + const rootDir = resolve(__dirname, '..', testCaseFolder); + // create base jest config object + let options: any = { rootDir, cwd: rootDir }; + // adds TS Jest options if any given + if (tsJest != null) { + options.globals = { 'ts-jest': tsJest }; + } + return options; +} diff --git a/tests/utils/test-utils.ts b/tests/__helpers__/test-utils.ts similarity index 94% rename from tests/utils/test-utils.ts rename to tests/__helpers__/test-utils.ts index c361a898c4..eacaa345ce 100644 --- a/tests/utils/test-utils.ts +++ b/tests/__helpers__/test-utils.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import { normalize } from 'jest-config'; import * as setFromArgv from 'jest-config/build/set_from_argv'; import * as path from 'path'; -import { JestConfigNormalize } from '../../src/jest-types'; +import { JestConfigNormalize } from '../../dist/types'; import { Arguments } from 'yargs'; function readRawConfig(argv: Arguments, root: string): JestConfigNormalize { @@ -60,7 +60,7 @@ function loadJestConfigFromFile( filePath: string, argv: Arguments, ): JestConfigNormalize { - const config = JSON.parse(fs.readFileSync(filePath, 'utf-8')); + const config = JSON.parse(fs.readFileSync(filePath, 'utf8')); config.rootDir = config.rootDir ? path.resolve(path.dirname(filePath), config.rootDir) : process.cwd(); diff --git a/tests/__helpers__/utils.ts b/tests/__helpers__/utils.ts index a241722ad3..e9395f9b3d 100644 --- a/tests/__helpers__/utils.ts +++ b/tests/__helpers__/utils.ts @@ -1,6 +1,7 @@ // from: https://github.com/facebook/jest/blob/master/integration_tests/utils.js import { sync as spawnSync } from 'cross-spawn'; import { Result } from './runJest'; +import { TsJestConfig } from '../../dist/types'; export function run(cmd, cwd) { const args = cmd.split(/\s/).slice(1); diff --git a/tests/__tests__/__snapshots__/html-transform.spec.ts.snap b/tests/__tests__/__snapshots__/html-transform.spec.ts.snap index bdea8378b9..1489c73e55 100644 --- a/tests/__tests__/__snapshots__/html-transform.spec.ts.snap +++ b/tests/__tests__/__snapshots__/html-transform.spec.ts.snap @@ -1,13 +1,17 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set 1`] = ` -"module.exports=\`
+exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set: module 1`] = ` +"
This is element -
\`;" + This is a backtilt \` +
" `; -exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set 2`] = ` +exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set: source 1`] = `"module.exports=\\"
\\\\n This is element\\\\n This is a backtilt \`\\\\n
\\";"`; + +exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set: untransformed 1`] = ` "
This is element + This is a backtilt \`
" `; diff --git a/tests/__tests__/__snapshots__/ts-coverage-async.spec.ts.snap b/tests/__tests__/__snapshots__/ts-coverage-async.spec.ts.snap new file mode 100644 index 0000000000..8439cd570a --- /dev/null +++ b/tests/__tests__/__snapshots__/ts-coverage-async.spec.ts.snap @@ -0,0 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Typescript async coverage Should generate the correct async coverage numbers 1`] = ` +" +=============================== Coverage summary =============================== +Statements : 71.43% ( 10/14 ) +Branches : 33.33% ( 2/6 ) +Functions : 66.67% ( 4/6 ) +Lines : 66.67% ( 8/12 ) +================================================================================ +" +`; diff --git a/tests/__tests__/__snapshots__/ts-coverage.spec.ts.snap b/tests/__tests__/__snapshots__/ts-coverage.spec.ts.snap new file mode 100644 index 0000000000..141c4d8d0a --- /dev/null +++ b/tests/__tests__/__snapshots__/ts-coverage.spec.ts.snap @@ -0,0 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Typescript coverage Should generate the correct coverage numbers. 1`] = ` +" +=============================== Coverage summary =============================== +Statements : 71.43% ( 10/14 ) +Branches : 33.33% ( 2/6 ) +Functions : 66.67% ( 4/6 ) +Lines : 66.67% ( 8/12 ) +================================================================================ +" +`; diff --git a/tests/__tests__/__snapshots__/tsconfig-comments.spec.ts.snap b/tests/__tests__/__snapshots__/tsconfig-comments.spec.ts.snap new file mode 100644 index 0000000000..e641618a0c --- /dev/null +++ b/tests/__tests__/__snapshots__/tsconfig-comments.spec.ts.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`parse tsconfig with comments new behaviour (tsConfigFile & tsConfig) should correctly read allow-comments.json 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "pretty": false, + "sourceMap": true, +} +`; + +exports[`parse tsconfig with comments new behaviour (tsConfigFile & tsConfig) should correctly read allow-comments2.json 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "pretty": false, + "sourceMap": true, +} +`; diff --git a/tests/__tests__/__snapshots__/tsconfig-default.spec.ts.snap b/tests/__tests__/__snapshots__/tsconfig-default.spec.ts.snap new file mode 100644 index 0000000000..59dc4907dd --- /dev/null +++ b/tests/__tests__/__snapshots__/tsconfig-default.spec.ts.snap @@ -0,0 +1,20 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`get default ts config new behavior (tsConfigFile & tsConfig) should not change the module if it is loaded from a non-default config file 1`] = `5`; + +exports[`get default ts config should correctly read tsconfig.json 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "moduleResolution": 2, + "noEmitOnError": false, + "sourceMap": true, + "target": 2, +} +`; diff --git a/tests/__tests__/__snapshots__/tsconfig-string.spec.ts.snap b/tests/__tests__/__snapshots__/tsconfig-string.spec.ts.snap new file mode 100644 index 0000000000..73cffd5d6f --- /dev/null +++ b/tests/__tests__/__snapshots__/tsconfig-string.spec.ts.snap @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`get ts config from string new behaviour (tsConfigFile & tsConfig) should correctly override any config in the "extends" directive 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "moduleResolution": 2, + "noEmitOnError": true, + "noImplicitAny": true, + "sourceMap": true, + "target": 1, +} +`; + +exports[`get ts config from string new behaviour (tsConfigFile & tsConfig) should correctly read my-tsconfig.json 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "moduleResolution": 2, + "noEmitOnError": true, + "sourceMap": true, + "target": 2, +} +`; + +exports[`get ts config from string new behaviour (tsConfigFile & tsConfig) should correctly resolve the "extends" directive 1`] = ` +Object { + "configFilePath": undefined, + "declaration": false, + "declarationMap": false, + "emitDeclarationOnly": false, + "inlineSourceMap": false, + "inlineSources": true, + "jsx": 2, + "module": 1, + "moduleResolution": 2, + "noEmitOnError": true, + "sourceMap": true, + "target": 2, +} +`; diff --git a/tests/__tests__/babel-config.spec.ts b/tests/__tests__/babel-config.spec.ts index 78ac240f5b..e77d1a0a57 100644 --- a/tests/__tests__/babel-config.spec.ts +++ b/tests/__tests__/babel-config.spec.ts @@ -10,7 +10,7 @@ describe('babelConfig flag', () => { const result = runJest('../babel-config-invalid', ['--no-cache', '-u']); const stderr = result.stderr; expect(result.status).toBe(1); - expect(stderr).toContain('ReferenceError: [BABEL]'); + expect(stderr).toContain('ReferenceError: Unknown option: .foo.'); expect(stderr).toContain( 'Check out http://babeljs.io/docs/usage/options/ for more information about options.', ); @@ -31,6 +31,6 @@ describe('babelConfig flag', () => { ]); const stderr = result.stderr; expect(result.status).toBe(1); - expect(stderr).toContain(`Couldn't find preset "nonexistent"`); + expect(stderr).toContain(`Cannot find module 'babel-preset-nonexistent'`); }); }); diff --git a/tests/__tests__/babelrc.spec.ts b/tests/__tests__/babelrc.spec.ts index 4767c4abf8..337143e7a7 100644 --- a/tests/__tests__/babelrc.spec.ts +++ b/tests/__tests__/babelrc.spec.ts @@ -5,7 +5,7 @@ describe('babelrc flag', () => { const result = runJest('../use-babelrc', ['--no-cache', '-u']); const stderr = result.stderr; expect(result.status).toBe(1); - expect(stderr).toContain('ReferenceError: [BABEL]'); + expect(stderr).toContain('ReferenceError: Unknown option: .foo.'); expect(stderr).toContain( 'Check out http://babeljs.io/docs/usage/options/ for more information about options.', ); diff --git a/tests/__tests__/debug.spec.ts b/tests/__tests__/debug.spec.ts index a3f810828e..82be3ccb4c 100644 --- a/tests/__tests__/debug.spec.ts +++ b/tests/__tests__/debug.spec.ts @@ -16,7 +16,7 @@ describe('Debug output', () => { runJest('../simple', ['--no-cache', '-u'], { TS_JEST_DEBUG: 'true', }); - const logFile = await fs.readFile(debugFilePath, 'utf-8'); + const logFile = await fs.readFile(debugFilePath, 'utf8'); expect(logFile).not.toBeNull(); }); @@ -24,6 +24,6 @@ describe('Debug output', () => { it('Should not create a file if the debug flag is not set', async () => { runJest('../simple', ['--no-cache', '-u']); expect.assertions(1); // To make sure we actually do assert the promise on the line below - await expect(fs.readFile(debugFilePath, 'utf-8')).rejects.toThrow(); + await expect(fs.readFile(debugFilePath, 'utf8')).rejects.toThrow(); }); }); diff --git a/tests/__tests__/disable-sourcemap-support.spec.ts b/tests/__tests__/disable-sourcemap-support.spec.ts index a0ac76438b..5594317fce 100644 --- a/tests/__tests__/disable-sourcemap-support.spec.ts +++ b/tests/__tests__/disable-sourcemap-support.spec.ts @@ -8,7 +8,8 @@ describe('Typescript errors', () => { const stderr = result.stderr; // The actual error is on line 18 - the line# being wrong here means sourcemaps are disabled. - expect(stderr).toContain('Hello.ts:8'); + expect(stderr).toMatch(/at .+Hello\.ts:\d+/); + expect(stderr).not.toContain('Hello.ts:18'); expectJestStatus(result, 1); }); }); diff --git a/tests/__tests__/get-cache-key.spec.ts b/tests/__tests__/get-cache-key.spec.ts index a85885b9e6..d71ccab5b6 100644 --- a/tests/__tests__/get-cache-key.spec.ts +++ b/tests/__tests__/get-cache-key.spec.ts @@ -1,47 +1,51 @@ -import { getCacheKey } from '../../src/preprocessor'; -import { TransformOptions } from '../../src/jest-types'; +import getCacheKey from '../../dist/utils/get-cache-key'; +import mockJestConfig from '../__helpers__/mock-jest-config'; +import _getTSConfig from '../../dist/utils/get-ts-config'; + +jest.mock('../../dist/utils/get-ts-config', () => { + return { + default: jest.fn(() => ({ foo: 'bar' })), + }; +}); + +// type casting +const getTSConfig: jest.Mock = _getTSConfig as any; describe('getCacheKey', () => { const src = 'console.log(123);'; - const filepath = '/tmp/filepath'; - const configStr = `{ - "globals": { - "__TS_CONFIG": { - "compilerOptions": { - "target": "ES5", - "module": "commonjs" - } - } - }, - "transform": { - "^.+\\\\.tsx?$": "../../preprocessor.js" - }, - "testRegex": "(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$" - }`; - const options: TransformOptions = { instrument: false }; + const jestConfig = { + ...mockJestConfig('simple'), + transform: { '^.+\\\\.tsx?$': '../../preprocessor.js' }, + testRegex: '(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$', + }; + const filepath = `${jestConfig.rootDir}/some-file.ts`; + const configStr = JSON.stringify(jestConfig); + const options = { instrument: false, rootDir: jestConfig.rootDir }; const originalHash = getCacheKey(src, filepath, configStr, options); it('should change hash when src changes', () => { const newSrc = 'console.log(1234);'; - const newHash = getCacheKey(newSrc, filepath, configStr); + const newHash = getCacheKey(newSrc, filepath, configStr, options); expect(newHash).not.toBe(originalHash); }); it('should change hash when filepath changes', () => { - const newPath = '/tmp/newfilepath'; - const newHash = getCacheKey(src, newPath, configStr); + const newPath = `${jestConfig.rootDir}/some-other-file.ts`; + const newHash = getCacheKey(src, newPath, configStr, options); expect(newHash).not.toBe(originalHash); }); it('should change hash when tsconfig changes', () => { - const newConfigStr = configStr.replace(`"ES5"`, `"ES2015"`); - const newHash = getCacheKey(src, filepath, newConfigStr); + getTSConfig.mockImplementationOnce(() => ({ not_foo: 'not bar' })); + const newHash = getCacheKey(src, filepath, configStr, options); expect(newHash).not.toBe(originalHash); }); it('should change hash when transform options change', () => { - const newOptions: TransformOptions = { instrument: true }; + const newOptions = { ...options, instrument: true }; const newHash = getCacheKey(src, filepath, configStr, newOptions); expect(newHash).not.toBe(originalHash); }); + + // TODO: test when package dependencies change }); diff --git a/tests/__tests__/html-transform.spec.ts b/tests/__tests__/html-transform.spec.ts index 3a2ad22e0f..b25d88fa1c 100644 --- a/tests/__tests__/html-transform.spec.ts +++ b/tests/__tests__/html-transform.spec.ts @@ -1,19 +1,47 @@ -import { process } from '../../src/preprocessor'; +import * as tsJest from '../../dist'; +import mockJestConfig from '../__helpers__/mock-jest-config'; -const source = `
+const TEST_CASE = 'simple'; +const FILENAME = 'some-file.html'; + +const fileContent = `
This is element + This is a backtilt \`
`; -const path = '/path/to/file.html'; -const config = { - globals: { - __TRANSFORM_HTML__: true, - }, -}; describe('Html transforms', () => { it('transforms html if config.globals.__TRANSFORM_HTML__ is set', () => { - expect(process(source, path, config)).toMatchSnapshot(); - delete config.globals.__TRANSFORM_HTML__; - expect(process(source, path, config)).toMatchSnapshot(); + let jestConfig; + + // get the untransformed version + jestConfig = mockJestConfig(TEST_CASE); + const untransformed = tsJest.process( + fileContent, + `${jestConfig.rootDir}/${FILENAME}`, + jestConfig, + ); + expect(untransformed).toBe(fileContent); + expect(untransformed).toMatchSnapshot('untransformed'); + + // ... then the one which should be transformed + jestConfig = { + ...mockJestConfig(TEST_CASE), + globals: { __TRANSFORM_HTML__: true }, + }; + const transformed = tsJest.process( + fileContent, + `${jestConfig.rootDir}/${FILENAME}`, + jestConfig, + ) as string; + expect(transformed).not.toBe(fileContent); + expect(transformed).toMatchSnapshot('source'); + + // ... finally the result of a `require('module-with-transformed-version')` + const value = eval( + `(function(){const module={}; ${transformed}; return module.exports;})()`, + ); + expect(value).toMatchSnapshot('module'); + // the value should be the same string as the source version + expect(value).toBe(fileContent); }); }); diff --git a/tests/__tests__/import-json.spec.ts b/tests/__tests__/import-json.spec.ts new file mode 100644 index 0000000000..9666e5c4a4 --- /dev/null +++ b/tests/__tests__/import-json.spec.ts @@ -0,0 +1,9 @@ +import runJest from '../__helpers__/runJest'; + +describe('Import JSON with `resolveJsonModule`', () => { + it('should work as expected', () => { + const result = runJest('../import-json', ['--no-cache']); + + expect(result.status).toBe(0); + }); +}); diff --git a/tests/__tests__/import.spec.ts b/tests/__tests__/import.spec.ts index a1ab94b68d..85f9f83290 100644 --- a/tests/__tests__/import.spec.ts +++ b/tests/__tests__/import.spec.ts @@ -1,5 +1,4 @@ import runJest from '../__helpers__/runJest'; -import { printStdStreams } from '../utils/test-utils'; describe('import with relative and absolute paths', () => { it('should run successfully', () => { diff --git a/tests/__tests__/jest-hoist.spec.ts b/tests/__tests__/jest-hoist.spec.ts index 81fb70d2bb..e117c915fd 100644 --- a/tests/__tests__/jest-hoist.spec.ts +++ b/tests/__tests__/jest-hoist.spec.ts @@ -15,10 +15,6 @@ describe('Jest.mock() calls', () => { const stderr = result.stderr; expect(stderr).toContain('Hello.ts:22:11'); - // TODO FIX COMMENT - sourcemap is accurate now - // The actual error occurs at line 14. However, because the mock calls - // are hoisted, this changes - in this case, to 22 - // The column numbers are accurate. expect(stderr).toContain('Hello.test.ts:14:19'); expect(result.status).toBe(1); diff --git a/tests/__tests__/jestconfig-json.spec.ts b/tests/__tests__/jestconfig-json.spec.ts index 3bb5e4ce2e..d01904edc7 100644 --- a/tests/__tests__/jestconfig-json.spec.ts +++ b/tests/__tests__/jestconfig-json.spec.ts @@ -1,5 +1,5 @@ import * as pkgDir from 'pkg-dir'; -import { getJestConfig } from '../utils/test-utils'; +import { getJestConfig } from '../__helpers__/test-utils'; describe('get json jest config', () => { let yargsMock; diff --git a/tests/__tests__/jestconfig-package.spec.ts b/tests/__tests__/jestconfig-package.spec.ts index 154f8f898c..97d61e3a09 100644 --- a/tests/__tests__/jestconfig-package.spec.ts +++ b/tests/__tests__/jestconfig-package.spec.ts @@ -1,5 +1,5 @@ import * as pkgDir from 'pkg-dir'; -import { getJestConfig } from '../utils/test-utils'; +import { getJestConfig } from '../__helpers__/test-utils'; describe('get package json config', () => { let yargsMock; diff --git a/tests/__tests__/postprocess.spec.ts b/tests/__tests__/postprocess.spec.ts index 6fa0d77049..8e03b265a0 100644 --- a/tests/__tests__/postprocess.spec.ts +++ b/tests/__tests__/postprocess.spec.ts @@ -1,4 +1,4 @@ -jest.mock('babel-core', () => { +jest.mock('@babel/core', () => { return { transform: jest.fn(() => { return { code: 'stubbed_code', map: 'stubbed_map' }; @@ -6,33 +6,36 @@ jest.mock('babel-core', () => { }; }); -import { getPostProcessHook } from '../../src/postprocess'; +import { getPostProcessHook } from '../../dist/postprocess'; +import mockJestConfig from '../__helpers__/mock-jest-config'; describe('postprocess', () => { - function runHook(tsCompilerOptions = {}, jestConfig = {}, tsJestConfig = {}) { - return getPostProcessHook(tsCompilerOptions, jestConfig, tsJestConfig)( - { code: 'input_code', map: 'input_source_map' }, + function runHook(jestConfig = {} as any) { + return getPostProcessHook({ rootDir: '/tmp/project', ...jestConfig })( + { code: 'input_code', map: '"input_source_map"' }, 'fake_file', - {}, - { instrument: null }, + {} as any, + { + instrument: null, + }, ); } it('skips postprocess when skipBabel=true', () => { - const transformMock = require.requireMock('babel-core').transform; + const transformMock = require.requireMock('@babel/core').transform; - runHook({}, {}, { skipBabel: true }); + runHook({ globals: { 'ts-jest': { skipBabel: true } } }); expect(transformMock).not.toBeCalled(); }); it('Adds no babel plugins by default', () => { - const transformMock = require.requireMock('babel-core').transform; + const transformMock = require.requireMock('@babel/core').transform; runHook(); - getPostProcessHook({}, {}, {})( - { code: 'input_code', map: 'input_source_map' }, + getPostProcessHook(mockJestConfig('simple'))( + { code: 'input_code', map: '"input_source_map"' }, 'fake_file', - {}, + {} as any, { instrument: null }, ); expect(transformMock).lastCalledWith( @@ -44,7 +47,7 @@ describe('postprocess', () => { }); it('doesn`t accumulate module transforms on consecutive calls', () => { - const transformMock = require.requireMock('babel-core').transform; + const transformMock = require.requireMock('@babel/core').transform; const tsJestConfig = { babelConfig: { plugins: ['some-plugin'], @@ -52,8 +55,8 @@ describe('postprocess', () => { skipBabel: false, }; - runHook({}, {}, tsJestConfig); - runHook({}, {}, tsJestConfig); + runHook({ globals: { 'ts-jest': tsJestConfig } }); + runHook({ globals: { 'ts-jest': tsJestConfig } }); expect(transformMock).lastCalledWith( expect.any(String), diff --git a/tests/__tests__/rel-config-paths.spec.ts b/tests/__tests__/rel-config-paths.spec.ts new file mode 100644 index 0000000000..eba5218699 --- /dev/null +++ b/tests/__tests__/rel-config-paths.spec.ts @@ -0,0 +1,24 @@ +import runJest from '../__helpers__/runJest'; + +describe('Use jest config from config dir', () => { + it('Should run all tests resolving tsconfig extends', () => { + const result = runJest('../rel-config-paths', [ + '--no-cache', + '--config=./config/jest.config.js', + ]); + + expect(result.status).toBe(0); + }); + + it('Should fail resolving tsconfig with wrong relative path', () => { + const result = runJest('../rel-config-paths', [ + '--no-cache', + '--config=./config/jest.config.invalid.js', + ]); + + expect(result.status).toBe(1); + expect(result.stderr).toContain( + 'Unable to find tsconfig file given "./tsconfig.test.json"', + ); + }); +}); diff --git a/tests/__tests__/transpile-if-ts.spec.ts b/tests/__tests__/transpile-if-ts.spec.ts deleted file mode 100644 index 3bb07b18d0..0000000000 --- a/tests/__tests__/transpile-if-ts.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { transpileIfTypescript } from '../../src/transpile-if-ts'; - -describe('transpileIfTypescript', () => { - it('should ignore anything non-TS', () => { - const contents = 'unaltered'; - expect(transpileIfTypescript('some.js', contents)).toBe(contents); - }); - it('should be able to transpile some TS', () => { - const ts = 'const x:string = "anything";'; - expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";'); - expect(transpileIfTypescript('some.tsx', ts)).toMatch( - 'var x = "anything";', - ); - }); - - it('should be possible to pass a custom config', () => { - const customTsConfigFile = 'not-existant.json'; - const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile } }; - expect(() => - transpileIfTypescript('some.ts', '', customConfig), - ).toThrowError(); - }); -}); diff --git a/tests/__tests__/transpiler.spec.ts b/tests/__tests__/transpiler.spec.ts index abaab22f45..dfc6a0e48e 100644 --- a/tests/__tests__/transpiler.spec.ts +++ b/tests/__tests__/transpiler.spec.ts @@ -1,23 +1,34 @@ -import { transpileTypescript } from '../../src/transpiler'; +import { transpileTypescript } from '../../dist/transpiler'; import * as ts from 'typescript'; describe('transpileTypescript', () => { - - const compilerOptions: ts.CompilerOptions = {newLine: ts.NewLineKind.LineFeed}; + const compilerOptions: ts.CompilerOptions = { + newLine: ts.NewLineKind.LineFeed, + }; it('should transpile valid TS syntax', () => { - const result = transpileTypescript('valid.ts', 'var a = true;', compilerOptions); + const result = transpileTypescript( + 'valid.ts', + 'var a = true;', + compilerOptions, + ); expect(result.code).toBe('var a = true;\n'); }); it('should transpile valid TS syntax with type errors', () => { - const result = transpileTypescript('valid.ts', 'var a: string = true;', compilerOptions); + const result = transpileTypescript( + 'valid.ts', + 'var a: string = true;', + compilerOptions, + ); expect(result.code).toBe('var a = true;\n'); }); it('should throw an error when transpiling invalid TS syntax', () => { expect(() => { transpileTypescript('invalid.ts', 'var a = ;', compilerOptions); - }).toThrow('TypeScript compiler encountered syntax errors while transpiling. Errors: Expression expected.'); + }).toThrow( + 'TypeScript compiler encountered syntax errors while transpiling. Errors: Expression expected.', + ); }); }); diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index d88bbde8c9..1de647b91f 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -6,9 +6,6 @@ describe('Typescript async coverage', () => { const output = result.stdout; - expect(output).toContain('Statements : 71.43% ( 10/14 )'); - expect(output).toContain('Branches : 33.33% ( 2/6 )'); - expect(output).toContain('Functions : 66.67% ( 4/6 )'); - expect(output).toContain('Lines : 66.67% ( 8/12 )'); + expect(output).toMatchSnapshot(); }); }); diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index b607bb60cd..88f435c455 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -6,9 +6,6 @@ describe('Typescript coverage', () => { const output = result.stdout; - expect(output).toContain('Statements : 71.43% ( 10/14 )'); - expect(output).toContain('Branches : 33.33% ( 2/6 )'); - expect(output).toContain('Functions : 66.67% ( 4/6 )'); - expect(output).toContain('Lines : 66.67% ( 8/12 )'); + expect(output).toMatchSnapshot(); }); }); diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 7c2e6dbf24..28aa8a7f1b 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -1,8 +1,11 @@ import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as fs from 'fs'; -import { getTSConfig } from '../../src/utils'; +import getTSConfig from '../../dist/utils/get-ts-config'; import * as path from 'path'; +import mockJestConfig from '../__helpers__/mock-jest-config'; + +const TEST_CASE = 'tsconfig-test'; describe('parse tsconfig with comments', () => { const configFile1 = './tests/tsconfig-test/allows-comments.json'; @@ -11,6 +14,7 @@ describe('parse tsconfig with comments', () => { beforeEach(() => { // Set up some mocked out file info before each test ((path as any) as MockedPath).__setBaseDir('./tests/tsconfig-test'); + getTSConfig.cache.clear(); }); it('the two config files should exist', () => { @@ -24,34 +28,28 @@ describe('parse tsconfig with comments', () => { expect(() => { JSON.parse(fs.readFileSync(configFile1, 'utf8')); - }).toThrowError(); + }).toThrow(); expect(() => { JSON.parse(fs.readFileSync(configFile2, 'utf8')); - }).toThrowError(); + }).toThrow(); }); describe('new behaviour (tsConfigFile & tsConfig)', () => { - it('one config file should extend the other', () => { - const config = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'allows-comments.json', - }, - }); - - // allows-comments.json does not contain a "pretty" field, - // while allows-comments2.json does. Default value would be "false". - expect(config.pretty).toEqual(true); - }); - + // allows-comments.json does not contain a "pretty" field, + // while allows-comments2.json does. + // allow-comments.json extends allow-comments2.json it('should correctly read allow-comments.json', () => { - expect(() => { - getTSConfig({ - 'ts-jest': { - tsConfigFile: 'allows-comments.json', - }, - }); - }).not.toThrow(); + const tsConfig = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'allows-comments.json' }), + ); + expect(tsConfig).toMatchSnapshot(); + }); + it('should correctly read allow-comments2.json', () => { + const tsConfig = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'allows-comments2.json' }), + ); + expect(tsConfig).toMatchSnapshot(); }); }); }); diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index e3bc06b4e7..d9b3cae369 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -2,8 +2,12 @@ import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as ts from 'typescript'; -import { getTSConfig } from '../../src/utils'; +import getTSConfig from '../../dist/utils/get-ts-config'; import * as path from 'path'; +import mockJestConfig from '../__helpers__/mock-jest-config'; +import getTSJestConfig from '../../dist/utils/get-ts-jest-config'; + +const TEST_CASE = 'tsconfig-test'; describe('get default ts config', () => { beforeEach(() => { @@ -13,78 +17,57 @@ describe('get default ts config', () => { getTSConfig.cache.clear(); }); - it('should correctly read tsconfig.json', () => { - const result = getTSConfig(null); - - expect(result).toEqual({ - declaration: false, - declarationMap: false, - emitDeclarationOnly: false, - inlineSourceMap: true, - inlineSources: true, - target: ts.ScriptTarget.ES2015, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: false, - jsx: ts.JsxEmit.React, - }); - }); + it('should bail when no default tsconfig.json found', () => { + // there is no tsconfig file in that test module + ((path as any) as MockedPath).__setBaseDir('./tests/jestconfig-test'); - it('should not read my-tsconfig.json', () => { - const result = getTSConfig(null); - - expect(result).not.toEqual({ - target: ts.ScriptTarget.ES2015, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: true, - jsx: ts.JsxEmit.React, - }); + expect(() => getTSConfig(mockJestConfig('jestconfig-test'))).toThrowError( + /unable to find ts configuration file/i, + ); }); - it('should not read inline tsconfig options', () => { - const result = getTSConfig(null); + it('should correctly read tsconfig.json', () => { + const result = getTSConfig(mockJestConfig(TEST_CASE)); - expect(result).not.toEqual({ - module: ts.ModuleKind.CommonJS, - jsx: ts.JsxEmit.React, - }); + expect(result).toMatchSnapshot(); }); describe('new behavior (tsConfigFile & tsConfig)', () => { it('should be same results for null/undefined/etc.', () => { - const result = getTSConfig(null); - const resultUndefinedParam = getTSConfig(undefined); - const resultNullParam = getTSConfig(null); - const resultEmptyParam = getTSConfig({}); - const resultUndefinedContentFile = getTSConfig({ - 'ts-jest': { tsConfigFile: undefined }, - }); - const resultNullContentFile = getTSConfig({ - 'ts-jest': { tsConfigFile: null }, - }); - - expect(result).toEqual(resultUndefinedParam); - expect(result).toEqual(resultNullParam); - expect(result).toEqual(resultEmptyParam); - expect(result).toEqual(resultUndefinedContentFile); - expect(result).toEqual(resultNullContentFile); + const resultWithoutTsJestSection = getTSConfig( + mockJestConfig(TEST_CASE, null), + ); + const resultEmptyParam = getTSConfig(mockJestConfig(TEST_CASE, {})); + const resultUndefinedContentFile = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: undefined }), + ); + const resultNullContentFile = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: null }), + ); + + expect(resultEmptyParam).toEqual(resultWithoutTsJestSection); + expect(resultUndefinedContentFile).toEqual(resultWithoutTsJestSection); + expect(resultNullContentFile).toEqual(resultWithoutTsJestSection); }); it('should be different results for different rootDir with same jest config.', () => { - const rootConfig = getTSConfig({}); - const subConfig = getTSConfig({}, 'tsconfig-module'); + const rootConfig = getTSConfig(mockJestConfig(TEST_CASE)); + const subConfig = getTSConfig( + mockJestConfig(`${TEST_CASE}/tsconfig-module`), + ); expect(rootConfig).not.toEqual(subConfig); }); it('should not change the module if it is loaded from a non-default config file', () => { - const config = getTSConfig({ - 'ts-jest': { + const config = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'tsconfig-module/custom-config.json', - }, - }); + }), + ); + // snapshot would be enough here, but that adds a security in case we do not see it in a PR expect(config.module).toBe(ts.ModuleKind.ES2015); + expect(config.module).toMatchSnapshot(); }); it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { @@ -94,11 +77,9 @@ describe('get default ts config', () => { './tests/tsconfig-test/tsconfig-module', ); - const config = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'tsconfig.json', - }, - }); + const config = getTSConfig( + mockJestConfig(`${TEST_CASE}/tsconfig-module`), + ); expect(config.module).toBe(ts.ModuleKind.CommonJS); }); @@ -109,26 +90,27 @@ describe('get default ts config', () => { './tests/tsconfig-test/tsconfig-module', ); - const { getTSJestConfig } = require('../../src/utils'); - const config1 = getTSJestConfig({ - 'ts-jest': { - skipBabel: true, + globals: { + 'ts-jest': { + skipBabel: true, + }, }, }); expect(config1.skipBabel).toBe(true); const config2 = getTSJestConfig({ - 'ts-jest': { - skipBabel: false, + globals: { + 'ts-jest': { + skipBabel: false, + }, }, }); expect(config2.skipBabel).toBe(false); - expect(getTSJestConfig({ 'ts-jest': {} })).toEqual({}); + expect(getTSJestConfig({ globals: { 'ts-jest': {} } })).toEqual({}); expect(getTSJestConfig({})).toEqual({}); - expect(getTSJestConfig()).toEqual({}); }); }); diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index 210b6a2376..2267ac95e9 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -1,104 +1,50 @@ jest.mock('path'); -import { getTSConfig } from '../../dist/utils'; +import getTSConfig from '../../dist/utils/get-ts-config'; import * as ts from 'typescript'; import * as path from 'path'; +import mockJestConfig from '../__helpers__/mock-jest-config'; + +const TEST_CASE = 'tsconfig-test'; describe('get ts config from string', () => { beforeEach(() => { // Set up some mocked out file info before each test (path as any).__setBaseDir('./tests/tsconfig-test'); + getTSConfig.cache.clear(); }); describe('new behaviour (tsConfigFile & tsConfig)', () => { it('should correctly read my-tsconfig.json', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'my-tsconfig.json', - }, - }); - - expect(result).toMatchObject({ - inlineSourceMap: true, - inlineSources: true, - target: ts.ScriptTarget.ES2015, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: true, - jsx: ts.JsxEmit.React, - }); - }); - - it('should not read tsconfig.json', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'my-tsconfig.json', - }, - }); - - expect(result).not.toEqual({ - target: ts.ScriptTarget.ES2015, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: false, - jsx: ts.JsxEmit.React, - }); - }); - - it('should not read inline tsconfig options', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'my-tsconfig.json', - }, - }); + const result = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'my-tsconfig.json' }), + ); - expect(result).not.toEqual({ - target: ts.ScriptTarget.ES5, - jsx: ts.JsxEmit.React, - }); + // snapshot would be enough here, but that adds a security in case we do not see it in a PR + expect(result.target).toBe(ts.ScriptTarget.ES2015); // es6 resolves to ES2015 enum value + expect(result).toMatchSnapshot(); }); it('should correctly resolve the "extends" directive', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: 'extends-tsconfig.json', - }, - }); + const result = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'extends-tsconfig.json' }), + ); - expect(result).toEqual({ - declaration: false, - declarationMap: false, - emitDeclarationOnly: false, - inlineSourceMap: true, - inlineSources: true, - target: ts.ScriptTarget.ES2015, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: true, - jsx: ts.JsxEmit.React, - }); + // snapshot would be enough here, but that adds a security in case we do not see it in a PR + expect(result.target).toBe(ts.ScriptTarget.ES2015); // es6 resolves to ES2015 enum value + expect(result).toMatchSnapshot(); }); it('should correctly override any config in the "extends" directive', () => { - const result = getTSConfig({ - 'ts-jest': { + const result = getTSConfig( + mockJestConfig(TEST_CASE, { tsConfigFile: 'extends-with-overrides-tsconfig.json', - }, - }); + }), + ); - expect(result).toEqual({ - declaration: false, - declarationMap: false, - emitDeclarationOnly: false, - inlineSourceMap: true, - inlineSources: true, - target: ts.ScriptTarget.ES5, - module: ts.ModuleKind.CommonJS, - moduleResolution: ts.ModuleResolutionKind.NodeJs, - noEmitOnError: true, - jsx: ts.JsxEmit.React, - noImplicitAny: true, - }); + // snapshot would be enough here, but that adds a security in case we do not see it in a PR + expect(result.target).toBe(ts.ScriptTarget.ES5); + expect(result).toMatchSnapshot(); }); }); }); diff --git a/tests/babel-config-merge-ignore-babelrc/package.json b/tests/babel-config-merge-ignore-babelrc/package.json index cb81a5b885..2dd29123ba 100644 --- a/tests/babel-config-merge-ignore-babelrc/package.json +++ b/tests/babel-config-merge-ignore-babelrc/package.json @@ -18,7 +18,7 @@ "ts-jest": { "babelConfig": { "presets": [ - "env" + "@babel/env" ] } } diff --git a/tests/babel-config-merge-with-babelrc/package.json b/tests/babel-config-merge-with-babelrc/package.json index 9fc205d0bb..e740eb0fdb 100644 --- a/tests/babel-config-merge-with-babelrc/package.json +++ b/tests/babel-config-merge-with-babelrc/package.json @@ -18,7 +18,7 @@ "ts-jest": { "babelConfig": { "presets": [ - "env" + "@babel/env" ] }, "useBabelrc": true diff --git a/tests/button/package.json b/tests/button/package.json index 3c6d32dd17..9a38773d3e 100644 --- a/tests/button/package.json +++ b/tests/button/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "moduleFileExtensions": [ diff --git a/tests/dynamic-imports/jest.allowdefaultimports.json b/tests/dynamic-imports/jest.allowdefaultimports.json index e99202cbdc..7b6dca0e97 100644 --- a/tests/dynamic-imports/jest.allowdefaultimports.json +++ b/tests/dynamic-imports/jest.allowdefaultimports.json @@ -6,7 +6,7 @@ } }, "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "moduleFileExtensions": [ diff --git a/tests/dynamic-imports/package.json b/tests/dynamic-imports/package.json index da4ca2764d..629580a5c3 100644 --- a/tests/dynamic-imports/package.json +++ b/tests/dynamic-imports/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "moduleFileExtensions": [ diff --git a/tests/hoist-errors/package.json b/tests/hoist-errors/package.json index c303bdc8bb..bd5ac5950e 100644 --- a/tests/hoist-errors/package.json +++ b/tests/hoist-errors/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "coverageReporters": [ diff --git a/tests/hoist-test/__tests__/jest-hoist.test.ts b/tests/hoist-test/__tests__/jest-hoist.test.ts index ae01fd7949..83f92e02c7 100644 --- a/tests/hoist-test/__tests__/jest-hoist.test.ts +++ b/tests/hoist-test/__tests__/jest-hoist.test.ts @@ -19,11 +19,11 @@ describe('Local mocks', () => { expect((SomeClass as any).mockReturnValue).toBeDefined(); }); - it('Jest should be able to mock a local class', () => { + it('Jest should be able to mock a local function', () => { expect((SomeFunction as any).mockReturnValueOnce).toBeDefined(); }); - it('Jest should be able to mock a local class', () => { + it('Jest should be able to mock a local const', () => { expect( (SomeFunctionDeclaredAsConst as any).mockImplementation, ).toBeDefined(); diff --git a/tests/hoist-test/package.json b/tests/hoist-test/package.json index da7414e70f..c247ae1d78 100644 --- a/tests/hoist-test/package.json +++ b/tests/hoist-test/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": ["node_modules", "src"], "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", diff --git a/tests/import-json/.gitignore b/tests/import-json/.gitignore new file mode 100644 index 0000000000..4ebc8aea50 --- /dev/null +++ b/tests/import-json/.gitignore @@ -0,0 +1 @@ +coverage diff --git a/tests/import-json/__tests__/pkg.test.ts b/tests/import-json/__tests__/pkg.test.ts new file mode 100644 index 0000000000..b08106caa4 --- /dev/null +++ b/tests/import-json/__tests__/pkg.test.ts @@ -0,0 +1,9 @@ +declare var jest, describe, it, expect; + +import pkg from '../pkg'; + +describe('pkg', () => { + it('should statically import package.json', () => { + expect(pkg).toEqual(require('../package.json')); + }); +}); diff --git a/tests/import-json/package.json b/tests/import-json/package.json new file mode 100644 index 0000000000..1cd551ae47 --- /dev/null +++ b/tests/import-json/package.json @@ -0,0 +1,15 @@ +{ + "jest": { + "transform": { + "^.+\\.tsx?$": "ts-jest" + }, + "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json" + ] + } +} diff --git a/tests/import-json/pkg.ts b/tests/import-json/pkg.ts new file mode 100644 index 0000000000..8eed6e7938 --- /dev/null +++ b/tests/import-json/pkg.ts @@ -0,0 +1,3 @@ +import * as pkg from './package'; + +export default pkg; diff --git a/tests/import-json/tsconfig.json b/tests/import-json/tsconfig.json new file mode 100644 index 0000000000..1f3a011864 --- /dev/null +++ b/tests/import-json/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "resolveJsonModule": true + } +} diff --git a/tests/imports-test/package.json b/tests/imports-test/package.json index be12d7069a..b199be6bfc 100644 --- a/tests/imports-test/package.json +++ b/tests/imports-test/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": [ "node_modules", diff --git a/tests/metadata-emit/package.json b/tests/metadata-emit/package.json index 8fe30ad48a..091c3daa5a 100644 --- a/tests/metadata-emit/package.json +++ b/tests/metadata-emit/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": ["node_modules", "src"], "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", diff --git a/tests/no-synthetic-default/package.json b/tests/no-synthetic-default/package.json index da7414e70f..c247ae1d78 100644 --- a/tests/no-synthetic-default/package.json +++ b/tests/no-synthetic-default/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": ["node_modules", "src"], "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", diff --git a/tests/rel-config-paths/config/jest.config.invalid.js b/tests/rel-config-paths/config/jest.config.invalid.js new file mode 100644 index 0000000000..4f0b49dfe3 --- /dev/null +++ b/tests/rel-config-paths/config/jest.config.invalid.js @@ -0,0 +1,14 @@ +module.exports = { + errorOnDeprecated: true, + globals: { + 'ts-jest': { + tsConfigFile: './tsconfig.test.json', + }, + }, + moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'], + rootDir: '../', + testMatch: ['/custom-test-dir/**/*.ts'], + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, +}; diff --git a/tests/rel-config-paths/config/jest.config.js b/tests/rel-config-paths/config/jest.config.js new file mode 100644 index 0000000000..790e32b891 --- /dev/null +++ b/tests/rel-config-paths/config/jest.config.js @@ -0,0 +1,14 @@ +module.exports = { + errorOnDeprecated: true, + globals: { + 'ts-jest': { + tsConfigFile: '/config/tsconfig.test.json', + }, + }, + moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'], + rootDir: '../', + testMatch: ['/custom-test-dir/**/*.ts'], + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, +}; diff --git a/tests/rel-config-paths/config/tsconfig.base.json b/tests/rel-config-paths/config/tsconfig.base.json new file mode 100644 index 0000000000..3a7fb4da10 --- /dev/null +++ b/tests/rel-config-paths/config/tsconfig.base.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "outDir": "../dist" + } +} diff --git a/tests/rel-config-paths/config/tsconfig.test.json b/tests/rel-config-paths/config/tsconfig.test.json new file mode 100644 index 0000000000..8000a52a3a --- /dev/null +++ b/tests/rel-config-paths/config/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "include": [ + "../custom-test-dir" + ] +} diff --git a/tests/rel-config-paths/custom-test-dir/test.ts b/tests/rel-config-paths/custom-test-dir/test.ts new file mode 100644 index 0000000000..e1db5bd814 --- /dev/null +++ b/tests/rel-config-paths/custom-test-dir/test.ts @@ -0,0 +1,9 @@ +declare var jest, describe, it, expect; + +import { hi } from '../src'; + +describe('hi', () => { + it('should say hi', () => { + expect(hi()).toBe('HI!'); + }); +}); diff --git a/tests/rel-config-paths/package.json b/tests/rel-config-paths/package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/tests/rel-config-paths/package.json @@ -0,0 +1 @@ +{} diff --git a/tests/rel-config-paths/src/index.ts b/tests/rel-config-paths/src/index.ts new file mode 100644 index 0000000000..56966913e9 --- /dev/null +++ b/tests/rel-config-paths/src/index.ts @@ -0,0 +1,3 @@ +export function hi() { + return 'HI!'; +} diff --git a/tests/simple-async/package.json b/tests/simple-async/package.json index 8aae224457..5c775048ef 100644 --- a/tests/simple-async/package.json +++ b/tests/simple-async/package.json @@ -2,7 +2,7 @@ "jest": { "rootDir": "./", "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "coverageReporters": [ diff --git a/tests/simple-long-path/package.json b/tests/simple-long-path/package.json index 0b4b74c76f..b352c8c040 100644 --- a/tests/simple-long-path/package.json +++ b/tests/simple-long-path/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "coverageReporters": [ diff --git a/tests/skip-babelrc/package.json b/tests/skip-babelrc/package.json index c303bdc8bb..bd5ac5950e 100644 --- a/tests/skip-babelrc/package.json +++ b/tests/skip-babelrc/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "coverageReporters": [ diff --git a/tests/synthetic-default/package.json b/tests/synthetic-default/package.json index eee0ad2384..06ae571d76 100644 --- a/tests/synthetic-default/package.json +++ b/tests/synthetic-default/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": [ "node_modules", diff --git a/tests/ts-diagnostics/package.json b/tests/ts-diagnostics/package.json index 569aeaa778..c4fb8e5cca 100644 --- a/tests/ts-diagnostics/package.json +++ b/tests/ts-diagnostics/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": [ "node_modules", diff --git a/tests/ts-jest-module-interface/__tests__/ts-jest-module-interface.test.ts b/tests/ts-jest-module-interface/__tests__/ts-jest-module-interface.test.ts index 7f63667e82..5aee192c1c 100644 --- a/tests/ts-jest-module-interface/__tests__/ts-jest-module-interface.test.ts +++ b/tests/ts-jest-module-interface/__tests__/ts-jest-module-interface.test.ts @@ -1,4 +1,4 @@ -import * as tsJest from 'ts-jest'; +import * as tsJest from '../../../dist'; describe('ts-jest module interface', () => { it('is an object', () => { @@ -10,4 +10,10 @@ describe('ts-jest module interface', () => { it('has a getCacheKey function', () => { expect(typeof tsJest.getCacheKey).toBe('function'); }); + it('has a canInstrument property', () => { + expect(tsJest).toHaveProperty('canInstrument', true); + }); + it('has a createTransformer function', () => { + expect(typeof tsJest.createTransformer).toBe('function'); + }); }); diff --git a/tests/tsconfig-test/allows-comments2.json b/tests/tsconfig-test/allows-comments2.json index e5b406f1ca..1d84a98b46 100644 --- a/tests/tsconfig-test/allows-comments2.json +++ b/tests/tsconfig-test/allows-comments2.json @@ -1,6 +1,6 @@ { "compilerOptions": { //some comments - "pretty": true + "pretty": false } } diff --git a/tests/tsconfig.json b/tests/tsconfig.json deleted file mode 100644 index f4161e554b..0000000000 --- a/tests/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "sourceMap": false, - "declaration": true, - "target": "ES5", - "module": "commonjs", - "moduleResolution": "node", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": false, - "noImplicitReturns": true, - "removeComments": true, - "strictNullChecks": false, - "jsx": "react", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": false - }, - "include": [ - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file diff --git a/tests/use-babelrc/package.json b/tests/use-babelrc/package.json index df8c03a58a..a852e05bdb 100644 --- a/tests/use-babelrc/package.json +++ b/tests/use-babelrc/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "moduleDirectories": [ "node_modules", diff --git a/tests/use-config-from-node-modules/tsconfig.json b/tests/use-config-from-node-modules/tsconfig.json index 55f8667f97..5feb961b7d 100644 --- a/tests/use-config-from-node-modules/tsconfig.json +++ b/tests/use-config-from-node-modules/tsconfig.json @@ -6,5 +6,8 @@ "noEmitOnError": false, "jsx": "react", "allowJs": true - } + }, + "include": [ + "../../**/*" + ] } diff --git a/tests/use-strict/package.json b/tests/use-strict/package.json index da4ca2764d..629580a5c3 100644 --- a/tests/use-strict/package.json +++ b/tests/use-strict/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "moduleFileExtensions": [ diff --git a/tests/watch-test/package.json b/tests/watch-test/package.json index ce61e59e39..38eaac4de2 100644 --- a/tests/watch-test/package.json +++ b/tests/watch-test/package.json @@ -1,7 +1,7 @@ { "jest": { "transform": { - "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" + "^.+\\.tsx?$": "/node_modules/ts-jest/dist/index.js" }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "coverageReporters": [ diff --git a/tsconfig.json b/tsconfig.base.json similarity index 72% rename from tsconfig.json rename to tsconfig.base.json index 92f6d74376..d1a8c133ba 100644 --- a/tsconfig.json +++ b/tsconfig.base.json @@ -1,8 +1,9 @@ { "compilerOptions": { "sourceMap": false, + "inlineSourceMap": true, "declaration": true, - "target": "ES5", + "target": "es5", "module": "commonjs", "moduleResolution": "node", "noEmitOnError": true, @@ -11,20 +12,13 @@ "noImplicitReturns": true, "removeComments": true, "strictNullChecks": false, - "inlineSourceMap": true, "jsx": "react", "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": false, - "outDir": "dist", - "rootDir": "src", - "skipLibCheck": true + "skipLibCheck": true, + "lib": ["es2015"], + "types": ["jest"] }, - "include": [ - "src/**/*.ts", - "src/**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "exclude": ["**/node_modules/**/*"] } diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000000..6686956918 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "sourceMap": false, + "removeComments": true, + "outDir": "dist", + "rootDir": "src", + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/tslint.json b/tslint.json index 4c6b028a3c..2fd6de0110 100644 --- a/tslint.json +++ b/tslint.json @@ -31,5 +31,11 @@ ], "no-empty": false, "member-access": false + }, + "linterOptions": { + "exclude": [ + "dist/**/*", + "**/node_modules/**/*" + ] } } diff --git a/yarn.lock b/yarn.lock index 77725367eb..5c45a2fba7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,12 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.54.tgz#0024f96fdf7028a21d68e273afd4e953214a1ead" + dependencies: + "@babel/highlight" "7.0.0-beta.54" + "@babel/code-frame@^7.0.0-beta.35": version "7.0.0-beta.35" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.35.tgz#04eeb6dca7efef8f65776a4c214157303b85ad51" @@ -10,15 +16,514 @@ esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/core@^7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.54.tgz#253c54d0095403a5cfa764e7d9b458194692d02b" + dependencies: + "@babel/code-frame" "7.0.0-beta.54" + "@babel/generator" "7.0.0-beta.54" + "@babel/helpers" "7.0.0-beta.54" + "@babel/parser" "7.0.0-beta.54" + "@babel/template" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + convert-source-map "^1.1.0" + debug "^3.1.0" + json5 "^0.5.0" + lodash "^4.17.5" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.54.tgz#c043c7eebeebfd7e665d95c281a4aafc83d4e1c9" + dependencies: + "@babel/types" "7.0.0-beta.54" + jsesc "^2.5.1" + lodash "^4.17.5" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.54.tgz#1626126a3f9fc4ed280ac942372c7d39653d7121" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.54.tgz#d0a1967635b9eebcafdba80491917ee4981c12fa" + dependencies: + "@babel/helper-explode-assignable-expression" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-call-delegate@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.54.tgz#f6b72cfd832fb26eb2a806e18de05f88d3a8f302" + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-define-map@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.54.tgz#2036d7c49365987f091db9702ce2f3b55f677730" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/helper-explode-assignable-expression@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.54.tgz#cf067f3330965c2048bf087ea06f62c76d94a792" + dependencies: + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-function-name@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.54.tgz#307875507a1eda2482a09a9a4df6a25632ffb34b" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.54" + "@babel/template" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-get-function-arity@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.54.tgz#757bd189b077074a004028cfde5f083c306cc6c4" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-hoist-variables@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.54.tgz#8635be8095135ff73f753ed189e449f68b4f43cb" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-member-expression-to-functions@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0-beta.54.tgz#bce9ddc484317b13d2615bafe2b524d0d56d99df" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-module-imports@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.54.tgz#c2d8e14ff034225bf431356db77ef467b8d35aac" + dependencies: + "@babel/types" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/helper-module-transforms@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.54.tgz#8cc57eb0db5f0945d866524d555abd084e30cc35" + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.54" + "@babel/helper-simple-access" "7.0.0-beta.54" + "@babel/helper-split-export-declaration" "7.0.0-beta.54" + "@babel/template" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/helper-optimise-call-expression@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.54.tgz#4af8dd4ff90dbd29b3bcf85fff43952e2ae1016e" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-plugin-utils@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0-beta.54.tgz#61d2a9a0f9a3e31838a458debb9eebd7bdd249b4" + +"@babel/helper-regex@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0-beta.54.tgz#8ac562f855f132fc68dfd10b132552555ac870d9" + dependencies: + lodash "^4.17.5" + +"@babel/helper-remap-async-to-generator@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.54.tgz#39a50052aadd74d40c73b7c58eb963b90fac56d3" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.54" + "@babel/helper-wrap-function" "7.0.0-beta.54" + "@babel/template" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-replace-supers@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.54.tgz#901f5a1493a410799fd3ab3e0c0d29d18071c89f" + dependencies: + "@babel/helper-member-expression-to-functions" "7.0.0-beta.54" + "@babel/helper-optimise-call-expression" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-simple-access@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.54.tgz#5f760a19589a9b6f07e80a65ef4bcbd4fba8c253" + dependencies: + "@babel/template" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/helper-split-export-declaration@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.54.tgz#89cd8833c95481a0827ac6a1bfccddb92b75a109" + dependencies: + "@babel/types" "7.0.0-beta.54" + +"@babel/helper-wrap-function@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.54.tgz#dc1b7a483a3074a3531b36523e03156d910a3a2a" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.54" + "@babel/template" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/helpers@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.0.0-beta.54.tgz#b86a99a80efd81668caef307610b961197446a74" + dependencies: + "@babel/template" "7.0.0-beta.54" + "@babel/traverse" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + +"@babel/highlight@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.54.tgz#155d507358329b8e7068970017c3fd74a9b08584" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/parser@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.54.tgz#c01aa63b57c9c8dce8744796c81d9df121f20db4" + +"@babel/plugin-proposal-async-generator-functions@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.54.tgz#19871bd655b5d748b0ae3e9ecebe247be8b7f83b" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.54" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.54" + +"@babel/plugin-proposal-object-rest-spread@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.54.tgz#5481269a020dd0d38715a8094fed015d30ef4c2a" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.54" + +"@babel/plugin-proposal-optional-catch-binding@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.54.tgz#931f69298fa0c411b2596616cf5a1d82925b87a9" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.54" + +"@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.54.tgz#1624631faf688bcbde4918712bd0af7186f7d245" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-regex" "7.0.0-beta.54" + regexpu-core "^4.2.0" + +"@babel/plugin-syntax-async-generators@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.54.tgz#ffac8f64927614762897cc9643495fd38097dd41" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-syntax-object-rest-spread@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.54.tgz#e0f445612081ab573e2535adbabc7b710d17940c" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-syntax-optional-catch-binding@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.54.tgz#2eb8ddde19ddf73a343d087a087159ed44e54809" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-arrow-functions@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.54.tgz#44a977b8e61e4efcc7658bbbe260f204ca1bcf72" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-async-to-generator@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.54.tgz#d035e65c50884937d64dbe68d16498c032f8bbec" + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.54" + +"@babel/plugin-transform-block-scoped-functions@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.54.tgz#938a77fb12f0e11661bdf5386e4aeca47f0c053b" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-block-scoping@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.54.tgz#bcae1c2ffae4cc3b7b3e5455f0a98daecc09a3c6" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/plugin-transform-classes@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.54.tgz#b15781d2e499ce25438e73fea2fa5a09858568ff" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.54" + "@babel/helper-define-map" "7.0.0-beta.54" + "@babel/helper-function-name" "7.0.0-beta.54" + "@babel/helper-optimise-call-expression" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-replace-supers" "7.0.0-beta.54" + "@babel/helper-split-export-declaration" "7.0.0-beta.54" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.54.tgz#b28494942b94fb86d01994763d2b5c43bdd986af" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-destructuring@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.54.tgz#81f649a3e4fcb62c2b2ad497f783a800b994472f" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-dotall-regex@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0-beta.54.tgz#2835b7f4141b19fa0648eb96ffe3c4fccd1eca20" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-regex" "7.0.0-beta.54" + regexpu-core "^4.1.3" + +"@babel/plugin-transform-duplicate-keys@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.54.tgz#4b8f4fb349902a800679191f59d0fa53fca49400" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-exponentiation-operator@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.54.tgz#1017096366fb43ebca8ed8d8d0cdd1ebd64febb2" + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-for-of@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.54.tgz#261d2992058a9e09234b9ff67820054ffc55f79c" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-function-name@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.54.tgz#cc722f9973931337def3d1e6c55138581edd371e" + dependencies: + "@babel/helper-function-name" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-literals@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.54.tgz#70f07ecc2f3b7bc9f542a578e82eec18a5504098" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-modules-amd@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.54.tgz#fb50740741420bb485ee1315d2e1133db4e433d2" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-modules-commonjs@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.54.tgz#07d912a7a24dad2d9bf5d44ce322ddc457a8db37" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-simple-access" "7.0.0-beta.54" + +"@babel/plugin-transform-modules-systemjs@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.54.tgz#0923f012ac252e037467245ff27f8954f4ce6803" + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-modules-umd@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.54.tgz#3af0e2cf8f533b2984a8ca6da316246850c3aeda" + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-new-target@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.54.tgz#634ee57fa805720195cd31086c973f1fc5c9949b" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-object-super@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.54.tgz#d25fad66eff90de03ee62f8384f0af57bcd065d9" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-replace-supers" "7.0.0-beta.54" + +"@babel/plugin-transform-parameters@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.54.tgz#76306f19b9acac6cf13721af15ecb9f382864ff7" + dependencies: + "@babel/helper-call-delegate" "7.0.0-beta.54" + "@babel/helper-get-function-arity" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-regenerator@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.54.tgz#8b46e192f3bfe096bbbf86e27764e7662e5f9a0f" + dependencies: + regenerator-transform "^0.13.3" + +"@babel/plugin-transform-shorthand-properties@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.54.tgz#50e73c2afc5898b1055510ddf60ee13a6301517f" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-spread@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.54.tgz#4f0852df0f4b1db2426c40facd8fe5f028a3dbc9" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-sticky-regex@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.54.tgz#568f35eb5118ae96fad82eac36374d7923b47883" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-regex" "7.0.0-beta.54" + +"@babel/plugin-transform-template-literals@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.54.tgz#cb1f6303cafb8442a6c6c69a0dfbb60699f327bc" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-typeof-symbol@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.54.tgz#6d068686239c9ebaf534d1c0d8032953f7b521bc" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + +"@babel/plugin-transform-unicode-regex@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.54.tgz#1dc7e9150b39aaeb19fca1c863e082f6096afc60" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/helper-regex" "7.0.0-beta.54" + regexpu-core "^4.1.3" + +"@babel/preset-env@^7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.0.0-beta.54.tgz#4b05c4e3aaed64a509098e4e854dfc0e02edf053" + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.54" + "@babel/helper-plugin-utils" "7.0.0-beta.54" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.54" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.54" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.54" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.54" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.54" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.54" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.54" + "@babel/plugin-transform-arrow-functions" "7.0.0-beta.54" + "@babel/plugin-transform-async-to-generator" "7.0.0-beta.54" + "@babel/plugin-transform-block-scoped-functions" "7.0.0-beta.54" + "@babel/plugin-transform-block-scoping" "7.0.0-beta.54" + "@babel/plugin-transform-classes" "7.0.0-beta.54" + "@babel/plugin-transform-computed-properties" "7.0.0-beta.54" + "@babel/plugin-transform-destructuring" "7.0.0-beta.54" + "@babel/plugin-transform-dotall-regex" "7.0.0-beta.54" + "@babel/plugin-transform-duplicate-keys" "7.0.0-beta.54" + "@babel/plugin-transform-exponentiation-operator" "7.0.0-beta.54" + "@babel/plugin-transform-for-of" "7.0.0-beta.54" + "@babel/plugin-transform-function-name" "7.0.0-beta.54" + "@babel/plugin-transform-literals" "7.0.0-beta.54" + "@babel/plugin-transform-modules-amd" "7.0.0-beta.54" + "@babel/plugin-transform-modules-commonjs" "7.0.0-beta.54" + "@babel/plugin-transform-modules-systemjs" "7.0.0-beta.54" + "@babel/plugin-transform-modules-umd" "7.0.0-beta.54" + "@babel/plugin-transform-new-target" "7.0.0-beta.54" + "@babel/plugin-transform-object-super" "7.0.0-beta.54" + "@babel/plugin-transform-parameters" "7.0.0-beta.54" + "@babel/plugin-transform-regenerator" "7.0.0-beta.54" + "@babel/plugin-transform-shorthand-properties" "7.0.0-beta.54" + "@babel/plugin-transform-spread" "7.0.0-beta.54" + "@babel/plugin-transform-sticky-regex" "7.0.0-beta.54" + "@babel/plugin-transform-template-literals" "7.0.0-beta.54" + "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.54" + "@babel/plugin-transform-unicode-regex" "7.0.0-beta.54" + browserslist "^3.0.0" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.3.0" + +"@babel/template@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.54.tgz#d5b0d2d2d55c0e78b048c61a058f36cfd7d91af3" + dependencies: + "@babel/code-frame" "7.0.0-beta.54" + "@babel/parser" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + lodash "^4.17.5" + +"@babel/traverse@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.54.tgz#2c17f98dcdbf19aa918fde128f0e1a0bc089e05a" + dependencies: + "@babel/code-frame" "7.0.0-beta.54" + "@babel/generator" "7.0.0-beta.54" + "@babel/helper-function-name" "7.0.0-beta.54" + "@babel/helper-split-export-declaration" "7.0.0-beta.54" + "@babel/parser" "7.0.0-beta.54" + "@babel/types" "7.0.0-beta.54" + debug "^3.1.0" + globals "^11.1.0" + lodash "^4.17.5" + +"@babel/types@7.0.0-beta.54": + version "7.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.54.tgz#025ad68492fed542c13f14c579a44c848e531063" + dependencies: + esutils "^2.0.2" + lodash "^4.17.5" + to-fast-properties "^2.0.0" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" dependencies: any-observable "^0.3.0" -"@types/babel-core@latest": - version "6.25.3" - resolved "https://registry.yarnpkg.com/@types/babel-core/-/babel-core-6.25.3.tgz#c7fda09007375ae89942307917ed21ed309a1c2a" +"@types/babel-core@^6.25.5": + version "6.25.5" + resolved "https://registry.yarnpkg.com/@types/babel-core/-/babel-core-6.25.5.tgz#7598b1287c2cb5a8e9150d60e4d4a8f2dbe29982" dependencies: "@types/babel-generator" "*" "@types/babel-template" "*" @@ -27,31 +532,31 @@ "@types/babylon" "*" "@types/babel-generator@*": - version "6.25.0" - resolved "https://registry.yarnpkg.com/@types/babel-generator/-/babel-generator-6.25.0.tgz#8255469aa14712f0d1608b99683cabd5b413d96b" + version "6.25.2" + resolved "https://registry.yarnpkg.com/@types/babel-generator/-/babel-generator-6.25.2.tgz#fa13653ec2d34a4037be9c34dec32ae75bea04cc" dependencies: "@types/babel-types" "*" "@types/babel-template@*": - version "6.25.0" - resolved "https://registry.yarnpkg.com/@types/babel-template/-/babel-template-6.25.0.tgz#2505d7b55b88f821d98048b4fdf07b3b22563d30" + version "6.25.1" + resolved "https://registry.yarnpkg.com/@types/babel-template/-/babel-template-6.25.1.tgz#03e23a893c16bab2ec00200ab51feccf488cae78" dependencies: "@types/babel-types" "*" "@types/babylon" "*" "@types/babel-traverse@*": - version "6.25.2" - resolved "https://registry.yarnpkg.com/@types/babel-traverse/-/babel-traverse-6.25.2.tgz#3cfaebe316fec515a964adbb84147b3c8971ba9f" + version "6.25.4" + resolved "https://registry.yarnpkg.com/@types/babel-traverse/-/babel-traverse-6.25.4.tgz#269af6a25c80419b635c8fa29ae42b0d5ce2418c" dependencies: "@types/babel-types" "*" "@types/babel-types@*": - version "6.25.1" - resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-6.25.1.tgz#ce8f126a4403e11e1b0033a424f11638afac7889" + version "7.0.4" + resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.4.tgz#bfd5b0d0d1ba13e351dff65b6e52783b816826c8" "@types/babylon@*": - version "6.16.2" - resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.2.tgz#062ce63b693d9af1c246f5aedf928bc9c30589c8" + version "6.16.3" + resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.3.tgz#c2937813a89fcb5e79a00062fc4a8b143e7237bb" dependencies: "@types/babel-types" "*" @@ -65,9 +570,9 @@ dependencies: "@types/node" "*" -"@types/jest@^23.1.0": - version "23.1.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.1.3.tgz#4db19b2e7627dc254bbed5781b5609c621b5ad8e" +"@types/jest@^23.3.0": + version "23.3.0" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.0.tgz#5dd70033b616a6228042244ebd992f6426808810" "@types/lodash@^4.14.109": version "4.14.109" @@ -77,13 +582,13 @@ version "8.0.31" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.31.tgz#d9af61093cf4bfc9f066ca34de0175012cfb0ce9" -"@types/node@10.5.2": - version "10.5.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" +"@types/node@10.5.5": + version "10.5.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.5.tgz#8e84d24e896cd77b0d4f73df274027e3149ec2ba" -"@types/react@16.4.6": - version "16.4.6" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.6.tgz#5024957c6bcef4f02823accf5974faba2e54fada" +"@types/react@16.4.7": + version "16.4.7" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.7.tgz#f33f6d759a7e1833befa15224d68942d178a5a3f" dependencies: csstype "^2.2.0" @@ -349,29 +854,9 @@ babel-core@^6.0.0, babel-core@^6.26.0: slash "^1.0.0" source-map "^0.5.6" -babel-core@^6.26.3: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" +babel-core@^7.0.0-0: + version "7.0.0-bridge.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" babel-generator@^6.18.0: version "6.26.0" @@ -399,100 +884,6 @@ babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" @@ -500,12 +891,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.0.0.tgz#0e383a2aa6b3535e197db2929570a2182bd084e8" +babel-jest@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.4.0.tgz#22c34c392e2176f6a4c367992a7fcff69d2e8557" dependencies: babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.0.0" + babel-preset-jest "^23.2.0" babel-messages@^6.23.0: version "6.23.0" @@ -513,12 +904,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - dependencies: - babel-runtime "^6.22.0" - babel-plugin-istanbul@^4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" @@ -528,263 +913,19 @@ babel-plugin-istanbul@^4.1.6: istanbul-lib-instrument "^1.10.1" test-exclude "^4.2.1" -babel-plugin-jest-hoist@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.0.0.tgz#e61e68799f743391a1e6306ee270477aacf946c8" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - -babel-plugin-transform-async-to-generator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.23.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-preset-jest@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.0.0.tgz#49de0303f1b6875dcad6163eaa7eb8330d54824d" - dependencies: - babel-plugin-jest-hoist "^23.0.0" + babel-plugin-jest-hoist "^23.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" babel-register@^6.26.0: @@ -799,7 +940,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0, babel-runtime@^6.9.2: +babel-runtime@^6.22.0, babel-runtime@^6.26.0, babel-runtime@^6.9.2: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -816,7 +957,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: +babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -830,7 +971,7 @@ babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -943,7 +1084,13 @@ browser-resolve@^1.11.2: dependencies: resolve "1.1.7" -browserslist@^3.2.6: +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + +browserslist@^3.0.0: version "3.2.8" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" dependencies: @@ -991,8 +1138,8 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" caniuse-lite@^1.0.30000844: - version "1.0.30000846" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000846.tgz#2092911eecad71a89dae1faa62bcc202fde7f959" + version "1.0.30000865" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000865.tgz#70026616e8afe6e1442f8bb4e1092987d81a2f25" caseless@~0.12.0: version "0.12.0" @@ -1120,6 +1267,10 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +closest-file-data@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/closest-file-data/-/closest-file-data-0.1.4.tgz#975f87c132f299d24a0375b9f63ca3fb88f72b3a" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1179,7 +1330,7 @@ content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" -convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1: +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -1295,7 +1446,7 @@ date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" -debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1445,8 +1596,8 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" electron-to-chromium@^1.3.47: - version "1.3.48" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900" + version "1.3.52" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.52.tgz#d2d9f1270ba4a3b967b831c40ef71fb4d9ab5ce0" elegant-spinner@^1.0.1: version "1.0.1" @@ -1606,16 +1757,16 @@ expect@^22.4.0: jest-message-util "^22.4.0" jest-regex-util "^22.1.0" -expect@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-23.0.0.tgz#2c3ab0a44dae319e00a73e3561762768d03a2b27" +expect@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.4.0.tgz#6da4ecc99c1471253e7288338983ad1ebadb60c3" dependencies: ansi-styles "^3.2.0" - jest-diff "^23.0.0" + jest-diff "^23.2.0" jest-get-type "^22.1.0" - jest-matcher-utils "^23.0.0" - jest-message-util "^23.0.0" - jest-regex-util "^23.0.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" extend-shallow@^2.0.1: version "2.0.1" @@ -1661,6 +1812,10 @@ fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -1896,6 +2051,10 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.1.0: + version "11.7.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -2457,15 +2616,15 @@ istanbul-reports@^1.3.0: dependencies: handlebars "^4.0.3" -jest-changed-files@^22.2.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.4.3.tgz#8882181e022c38bd46a2e4d18d44d19d90a90fb2" +jest-changed-files@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.0.tgz#f1b304f98c235af5d9a31ec524262c5e4de3c6ff" dependencies: throat "^4.0.0" -jest-cli@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.0.0.tgz#29287498c9d844dcda5aaf011a4c82f9a888836e" +jest-cli@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.4.1.tgz#c1ffd33254caee376990aa2abe2963e0de4ca76b" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -2478,22 +2637,24 @@ jest-cli@^23.0.0: istanbul-lib-coverage "^1.2.0" istanbul-lib-instrument "^1.10.1" istanbul-lib-source-maps "^1.2.4" - jest-changed-files "^22.2.0" - jest-config "^23.0.0" - jest-environment-jsdom "^23.0.0" + jest-changed-files "^23.4.0" + jest-config "^23.4.1" + jest-environment-jsdom "^23.4.0" jest-get-type "^22.1.0" - jest-haste-map "^23.0.0" - jest-message-util "^23.0.0" - jest-regex-util "^23.0.0" - jest-resolve-dependencies "^23.0.0" - jest-runner "^23.0.0" - jest-runtime "^23.0.0" - jest-snapshot "^23.0.0" - jest-util "^23.0.0" - jest-validate "^23.0.0" - jest-worker "^23.0.0" + jest-haste-map "^23.4.1" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve-dependencies "^23.4.1" + jest-runner "^23.4.1" + jest-runtime "^23.4.1" + jest-snapshot "^23.4.1" + jest-util "^23.4.0" + jest-validate "^23.4.0" + jest-watcher "^23.4.0" + jest-worker "^23.2.0" micromatch "^2.3.11" node-notifier "^5.2.1" + prompts "^0.1.9" realpath-native "^1.0.0" rimraf "^2.5.4" slash "^1.0.0" @@ -2518,23 +2679,23 @@ jest-config@^22.4.2: jest-validate "^22.4.2" pretty-format "^22.4.0" -jest-config@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.0.0.tgz#9444d858873ad567376f8cfe139fd8828e8d494b" +jest-config@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.4.1.tgz#3172fa21f0507d7f8a088ed1dbe4157057f201e9" dependencies: babel-core "^6.0.0" - babel-jest "^23.0.0" + babel-jest "^23.4.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^23.0.0" - jest-environment-node "^23.0.0" + jest-environment-jsdom "^23.4.0" + jest-environment-node "^23.4.0" jest-get-type "^22.1.0" - jest-jasmine2 "^23.0.0" - jest-regex-util "^23.0.0" - jest-resolve "^23.0.0" - jest-util "^23.0.0" - jest-validate "^23.0.0" - pretty-format "^23.0.0" + jest-jasmine2 "^23.4.1" + jest-regex-util "^23.3.0" + jest-resolve "^23.4.1" + jest-util "^23.4.0" + jest-validate "^23.4.0" + pretty-format "^23.2.0" jest-diff@^22.4.0: version "22.4.0" @@ -2545,21 +2706,28 @@ jest-diff@^22.4.0: jest-get-type "^22.1.0" pretty-format "^22.4.0" -jest-diff@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.0.0.tgz#0a00b2157f518eec338121ccf8879c529269a88e" +jest-diff@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.2.0.tgz#9f2cf4b51e12c791550200abc16b47130af1062a" dependencies: chalk "^2.0.1" diff "^3.2.0" jest-get-type "^22.1.0" - pretty-format "^23.0.0" + pretty-format "^23.2.0" -jest-docblock@^22.4.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.3.tgz#50886f132b42b280c903c592373bb6e93bb68b19" +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" dependencies: detect-newline "^2.1.0" +jest-each@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.4.0.tgz#2fa9edd89daa1a4edc9ff9bf6062a36b71345143" + dependencies: + chalk "^2.0.1" + pretty-format "^23.2.0" + jest-environment-jsdom@^22.4.1: version "22.4.1" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.4.1.tgz#754f408872441740100d3917e5ec40c74de6447f" @@ -2568,12 +2736,12 @@ jest-environment-jsdom@^22.4.1: jest-util "^22.4.1" jsdom "^11.5.1" -jest-environment-jsdom@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.0.0.tgz#57b0f0dd263359a86d7952a4b712b3fabca1a625" +jest-environment-jsdom@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" dependencies: - jest-mock "^23.0.0" - jest-util "^23.0.0" + jest-mock "^23.2.0" + jest-util "^23.4.0" jsdom "^11.5.1" jest-environment-node@^22.4.1: @@ -2583,26 +2751,26 @@ jest-environment-node@^22.4.1: jest-mock "^22.2.0" jest-util "^22.4.1" -jest-environment-node@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.0.0.tgz#ef93a414a612484cf585c8b32ccc5ae30ce6095c" +jest-environment-node@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" dependencies: - jest-mock "^23.0.0" - jest-util "^23.0.0" + jest-mock "^23.2.0" + jest-util "^23.4.0" jest-get-type@^22.1.0: version "22.1.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9" -jest-haste-map@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.0.0.tgz#09be1c9a37c16b2e2f25398864eb2806d309ca96" +jest-haste-map@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.4.1.tgz#43a174ba7ac079ae1dd74eaf5a5fe78989474dd2" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^22.4.0" - jest-serializer "^23.0.0" - jest-worker "^23.0.0" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" micromatch "^2.3.11" sane "^2.0.0" @@ -2622,26 +2790,27 @@ jest-jasmine2@^22.4.2: jest-util "^22.4.1" source-map-support "^0.5.0" -jest-jasmine2@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.0.0.tgz#ea26f87b5c223e1a70985032f0727d8f855e59df" +jest-jasmine2@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.4.1.tgz#fa192262430d418e827636e4a98423e5e7ff0fce" dependencies: chalk "^2.0.1" co "^4.6.0" - expect "^23.0.0" + expect "^23.4.0" is-generator-fn "^1.0.0" - jest-diff "^23.0.0" - jest-matcher-utils "^23.0.0" - jest-message-util "^23.0.0" - jest-snapshot "^23.0.0" - jest-util "^23.0.0" - pretty-format "^23.0.0" + jest-diff "^23.2.0" + jest-each "^23.4.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-snapshot "^23.4.1" + jest-util "^23.4.0" + pretty-format "^23.2.0" -jest-leak-detector@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.0.0.tgz#ec93d755b21e8b2c4c4e59b8cccab1805a704ab3" +jest-leak-detector@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz#c289d961dc638f14357d4ef96e0431ecc1aa377d" dependencies: - pretty-format "^23.0.0" + pretty-format "^23.2.0" jest-matcher-utils@^22.4.0: version "22.4.0" @@ -2651,13 +2820,13 @@ jest-matcher-utils@^22.4.0: jest-get-type "^22.1.0" pretty-format "^22.4.0" -jest-matcher-utils@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.0.0.tgz#ca2168fe5a7a416c0d7f2916e969e89dcce9d92a" +jest-matcher-utils@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz#4d4981f23213e939e3cedf23dc34c747b5ae1913" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" - pretty-format "^23.0.0" + pretty-format "^23.2.0" jest-message-util@^22.4.0: version "22.4.0" @@ -2669,9 +2838,9 @@ jest-message-util@^22.4.0: slash "^1.0.0" stack-utils "^1.0.1" -jest-message-util@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.0.0.tgz#073f3d76c701f7c718a4b9af1eb7f138792c4796" +jest-message-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" dependencies: "@babel/code-frame" "^7.0.0-beta.35" chalk "^2.0.1" @@ -2683,24 +2852,24 @@ jest-mock@^22.2.0: version "22.2.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7" -jest-mock@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.0.0.tgz#d9d897a1b74dc05c66a737213931496215897dd8" +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" jest-regex-util@^22.1.0: version "22.1.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-22.1.0.tgz#5daf2fe270074b6da63e5d85f1c9acc866768f53" -jest-regex-util@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.0.0.tgz#dd5c1fde0c46f4371314cf10f7a751a23f4e8f76" +jest-regex-util@^23.3.0: + version "23.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" -jest-resolve-dependencies@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.0.0.tgz#c3e1cfee0e543dee10e6ec0628df69cd239244c9" +jest-resolve-dependencies@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.4.1.tgz#a1d85247e2963f8b3859f6b0ec61b741b359378e" dependencies: - jest-regex-util "^23.0.0" - jest-snapshot "^23.0.0" + jest-regex-util "^23.3.0" + jest-snapshot "^23.4.1" jest-resolve@^22.4.2: version "22.4.2" @@ -2709,51 +2878,51 @@ jest-resolve@^22.4.2: browser-resolve "^1.11.2" chalk "^2.0.1" -jest-resolve@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.0.0.tgz#f04362fd0531b4546399df76c55c3214a9f45e02" +jest-resolve@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.4.1.tgz#7f3c17104732a2c0c940a01256025ed745814982" dependencies: - browser-resolve "^1.11.2" + browser-resolve "^1.11.3" chalk "^2.0.1" realpath-native "^1.0.0" -jest-runner@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.0.0.tgz#b198a2dd78d57a2c0f3f8d7c7f97b62673922020" +jest-runner@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.4.1.tgz#d41fd1459b95d35d6df685f1468c09e617c8c260" dependencies: exit "^0.1.2" graceful-fs "^4.1.11" - jest-config "^23.0.0" - jest-docblock "^22.4.0" - jest-haste-map "^23.0.0" - jest-jasmine2 "^23.0.0" - jest-leak-detector "^23.0.0" - jest-message-util "^23.0.0" - jest-runtime "^23.0.0" - jest-util "^23.0.0" - jest-worker "^23.0.0" + jest-config "^23.4.1" + jest-docblock "^23.2.0" + jest-haste-map "^23.4.1" + jest-jasmine2 "^23.4.1" + jest-leak-detector "^23.2.0" + jest-message-util "^23.4.0" + jest-runtime "^23.4.1" + jest-util "^23.4.0" + jest-worker "^23.2.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.0.0.tgz#8619227fe2e01603d542b9101dd3e64ef4593f66" +jest-runtime@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.4.1.tgz#c1822eba5eb19294debe6b25b2760d0a8c532fd1" dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.1.6" chalk "^2.0.1" convert-source-map "^1.4.0" exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.11" - jest-config "^23.0.0" - jest-haste-map "^23.0.0" - jest-message-util "^23.0.0" - jest-regex-util "^23.0.0" - jest-resolve "^23.0.0" - jest-snapshot "^23.0.0" - jest-util "^23.0.0" - jest-validate "^23.0.0" - json-stable-stringify "^1.0.1" + jest-config "^23.4.1" + jest-haste-map "^23.4.1" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.4.1" + jest-snapshot "^23.4.1" + jest-util "^23.4.0" + jest-validate "^23.4.0" micromatch "^2.3.11" realpath-native "^1.0.0" slash "^1.0.0" @@ -2761,9 +2930,9 @@ jest-runtime@^23.0.0: write-file-atomic "^2.1.0" yargs "^11.0.0" -jest-serializer@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.0.tgz#263411ac92e1e3dde243858642bb04e8a986e8ca" +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" jest-snapshot@^22.4.0: version "22.4.0" @@ -2776,16 +2945,21 @@ jest-snapshot@^22.4.0: natural-compare "^1.4.0" pretty-format "^22.4.0" -jest-snapshot@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.0.0.tgz#49cdb92a69b9999dbf92e0634d5ba1e8a8586803" +jest-snapshot@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.4.1.tgz#090de9acae927f6a3af3005bda40d912b83e9c96" dependencies: + babel-traverse "^6.0.0" + babel-types "^6.0.0" chalk "^2.0.1" - jest-diff "^23.0.0" - jest-matcher-utils "^23.0.0" + jest-diff "^23.2.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-resolve "^23.4.1" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^23.0.0" + pretty-format "^23.2.0" + semver "^5.5.0" jest-util@^22.4.1: version "22.4.1" @@ -2799,16 +2973,17 @@ jest-util@^22.4.1: mkdirp "^0.5.1" source-map "^0.6.0" -jest-util@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.0.0.tgz#86386800ffbe3fe17a06320e0cf9ca9b7868263b" +jest-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" dependencies: callsites "^2.0.0" chalk "^2.0.1" graceful-fs "^4.1.11" is-ci "^1.0.10" - jest-message-util "^23.0.0" + jest-message-util "^23.4.0" mkdirp "^0.5.1" + slash "^1.0.0" source-map "^0.6.0" jest-validate@^22.4.0, jest-validate@^22.4.2: @@ -2821,27 +2996,39 @@ jest-validate@^22.4.0, jest-validate@^22.4.2: leven "^2.1.0" pretty-format "^22.4.0" -jest-validate@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.0.0.tgz#f88bc897b6cc376979aff0262d1025df1302d520" +jest-validate@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.4.0.tgz#d96eede01ef03ac909c009e9c8e455197d48c201" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" leven "^2.1.0" - pretty-format "^23.0.0" + pretty-format "^23.2.0" + +jest-watcher@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" -jest-worker@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.0.0.tgz#e6b1378b81f8e6a108f3be33a1faa830c22ea450" +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" dependencies: merge-stream "^1.0.1" -jest@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-23.0.0.tgz#9282980309f5cde27aadc59ae583f1117c0e4430" +jest@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.4.1.tgz#39550c72f3237f63ae1b434d8d122cdf6fa007b6" dependencies: import-local "^1.0.0" - jest-cli "^23.0.0" + jest-cli "^23.4.1" + +js-levenshtein@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.3.tgz#3ef627df48ec8cf24bacf05c0f184ff30ef413c5" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -2891,6 +3078,10 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" +jsesc@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" @@ -2917,7 +3108,7 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json5@^0.5.1: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2960,6 +3151,10 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" +kleur@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-1.0.2.tgz#637f126d3cda40a423b1297da88cf753bd04ebdd" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -3702,14 +3897,14 @@ pretty-format@^22.4.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-format@^23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.0.0.tgz#b66dc584a0907b1969783c4c20e4d1180b18ac75" +pretty-format@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" dependencies: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -private@^0.1.6, private@^0.1.7, private@^0.1.8: +private@^0.1.6, private@^0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -3727,6 +3922,13 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +prompts@^0.1.9: + version "0.1.12" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.12.tgz#39dc42de7d2f0ec3e2af76bf40713fcb8726090d" + dependencies: + kleur "^1.0.0" + sisteransi "^0.1.1" + prop-types@^15.6.0: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" @@ -3857,20 +4059,24 @@ reflect-metadata@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.12.tgz#311bf0c6b63cd782f228a81abe146a2bfa9c56f2" -regenerate@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" +regenerate-unicode-properties@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" regenerator-runtime@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" +regenerator-transform@^0.13.3: + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" private "^0.1.6" regex-cache@^0.4.2: @@ -3886,21 +4092,24 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" +regexpu-core@^4.1.3, regexpu-core@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" + regenerate "^1.4.0" + regenerate-unicode-properties "^7.0.0" + regjsgen "^0.4.0" + regjsparser "^0.3.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.0.2" -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" +regjsgen@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" +regjsparser@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" dependencies: jsesc "~0.5.0" @@ -4195,6 +4404,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -4281,7 +4494,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.3, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.6: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -4538,6 +4751,10 @@ to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -4592,19 +4809,6 @@ trough@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.1.tgz#a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86" -ts-jest@23.0.0: - version "23.0.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.0.0.tgz#3216310fb51e40789c6e4aa20bfe80198d250e9b" - dependencies: - babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.0.0" - cpx "^1.5.0" - fs-extra "6.0.1" - jest-config "^23.0.0" - lodash "^4.17.10" - pkg-dir "^3.0.0" - yargs "^12.0.1" - tslib@^1.8.0, tslib@^1.8.1: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" @@ -4613,9 +4817,9 @@ tslib@^1.9.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7" -tslint@^5.10.0: - version "5.10.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.10.0.tgz#11e26bccb88afa02dd0d9956cae3d4540b5f54c3" +tslint@^5.11.0: + version "5.11.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed" dependencies: babel-code-frame "^6.22.0" builtin-modules "^1.1.1" @@ -4628,11 +4832,11 @@ tslint@^5.10.0: resolve "^1.3.2" semver "^5.3.0" tslib "^1.8.0" - tsutils "^2.12.1" + tsutils "^2.27.2" -tsutils@^2.12.1: - version "2.22.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.22.1.tgz#30450bd701be623b9e11a129df0c32322678461b" +tsutils@^2.27.2: + version "2.28.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1" dependencies: tslib "^1.8.1" @@ -4652,9 +4856,9 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -typescript@^2.8.3: - version "2.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170" +typescript@^2.9.2: + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" ua-parser-js@^0.7.9: version "0.7.17" @@ -4688,6 +4892,25 @@ unherit@^1.0.4: inherits "^2.0.1" xtend "^4.0.1" +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + unified@^4.1.1: version "4.2.1" resolved "https://registry.yarnpkg.com/unified/-/unified-4.2.1.tgz#76ff43aa8da430f6e7e4a55c84ebac2ad2cfcd2e"