From 49518eb2ff292cfa6c127418400b54b6c23562c6 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Thu, 1 Dec 2016 16:40:31 +0100 Subject: [PATCH 001/256] Temporary fix for #53 omitting some tests on AppVeyor. --- appveyor.yml | 1 + scripts/tests.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a3d68361a8..583130c035 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,6 +19,7 @@ environment: install: - ps: Install-Product node $env:nodejs_version - set CI=true + - set AppVeyor=true - npm i -g npm@latest - set PATH=%APPDATA%\npm;%PATH% - npm install diff --git a/scripts/tests.js b/scripts/tests.js index 83c0eace5b..4ab073c918 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -8,7 +8,13 @@ const argv = process.argv.slice(2); argv.push('--no-cache'); // Watch unless on CI if (!process.env.CI) { - //argv.push('--watch'); + // argv.push('--watch'); +} +// omit tests for watch cases if it runned on AppVeyor due to this issues: +// https://github.com/kulshekhar/ts-jest/issues/53 +// http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem +if (process.env.AppVeyor) { + argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); } jest.run(argv); From 1337c7039a32b51dcef312e3e8c2857e209a1c82 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 1 Dec 2016 21:41:15 +0530 Subject: [PATCH 002/256] Fix AppVeyor badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83ee140dfb..10a97b1eb0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](https://travis-ci.org/kulshekhar/ts-jest) -[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/gknb1pl72o0w0coc?svg=true)](https://ci.appveyor.com/project/Igmat/ts-jest) +[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest) [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![dependencies](https://david-dm.org/kulshekhar/ts-jest.svg)](https://www.npmjs.com/package/ts-jest) From aeff3cd69ff28f68b7f018bbe6aaa0d9735a6563 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 13:11:11 +0100 Subject: [PATCH 003/256] Improvement of test script inspired by #71 --- .gitignore | 3 --- scripts/tests.js | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b1d45c0a1f..116a3fe641 100644 --- a/.gitignore +++ b/.gitignore @@ -41,8 +41,5 @@ jspm_packages # Optional REPL history .node_repl_history -# We need to include this folders, because they are mocks for integration tests -!tests/**/node_modules - .vscode .idea diff --git a/scripts/tests.js b/scripts/tests.js index 4ab073c918..e98fe8cf4d 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -3,18 +3,53 @@ process.env.PUBLIC_URL = ''; const jest = require('jest'); const fs = require('fs'); +const path = require('path'); + +function dirExists(dirPath) { + const F_OK = fs.constants && fs.constants.F_OK || fs['F_OK']; + try { + fs.accessSync(dirPath, F_OK); + return fs.statSync(dirPath).isDirectory(); + } catch (e) { + return false; + } +} + +function getDirectories(rootDir) { + return fs.readdirSync(rootDir).filter(function(file) { + return fs.statSync(path.join(rootDir, file)).isDirectory(); + }); +} + +function createIntegrationMock() { + const integrationMockContent = 'module.exports = require(\'../../../\');'; + const testsRoot = 'tests'; + const testCaseFolders = getDirectories(testsRoot).filter(function(testDir) { + return !(testDir.startsWith('__') && testDir.endsWith('__')); + }); + for (let i = 0; i < testCaseFolders.length; i++) { + const testCaseModuleFolder = path.join(testsRoot, testCaseFolders[i], 'node_modules'); + if (!dirExists(testCaseModuleFolder)) { + fs.mkdirSync(testCaseModuleFolder); + const integrationMockPath = path.join(testCaseModuleFolder, 'ts-jest.js'); + fs.appendFileSync(integrationMockPath, integrationMockContent); + } + } +} + +createIntegrationMock(); const argv = process.argv.slice(2); argv.push('--no-cache'); // Watch unless on CI if (!process.env.CI) { - // argv.push('--watch'); + // argv.push('--watch'); } // omit tests for watch cases if it runned on AppVeyor due to this issues: // https://github.com/kulshekhar/ts-jest/issues/53 // http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem if (process.env.AppVeyor) { - argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); + argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); } jest.run(argv); From 4cd6ecbd90de71ca78465f1f3e6c13b1b6ef6b50 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 13:14:05 +0100 Subject: [PATCH 004/256] Fix for node v4 --- scripts/tests.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tests.js b/scripts/tests.js index e98fe8cf4d..b5714207ea 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -1,3 +1,5 @@ +'use strict'; + process.env.NODE_ENV = 'test'; process.env.PUBLIC_URL = ''; From 28665488ab60d4b46aa24cf4bf0d588f2c1769b4 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 13:16:37 +0100 Subject: [PATCH 005/256] Removing allowed failure because node v7 released --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index edfba37470..da21fb2e88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,3 @@ before_install: - npm i -g npm@latest sudo: false - -matrix: - allow_failures: - - node_js: "7" From e10773651019659086ee55ff7055d718f362c9d2 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 17:38:18 +0100 Subject: [PATCH 006/256] Tests for #64 --- tests/__tests__/import.spec.ts | 29 +++++++++++++++++++ .../__tests__/absolute-import.test.ts | 10 +++++++ .../__tests__/classes/Hello-relative.test.ts | 13 +++++++++ .../__tests__/classes/Hello.test.ts | 13 +++++++++ .../__tests__/relative-import.test.ts | 10 +++++++ tests/imports-test/package.json | 14 +++++++++ tests/imports-test/src/absolute-import.ts | 5 ++++ tests/imports-test/src/classes/Hello.ts | 13 +++++++++ tests/imports-test/src/relative-import.ts | 5 ++++ tests/imports-test/tsconfig.json | 11 +++++++ 10 files changed, 123 insertions(+) create mode 100644 tests/__tests__/import.spec.ts create mode 100644 tests/imports-test/__tests__/absolute-import.test.ts create mode 100644 tests/imports-test/__tests__/classes/Hello-relative.test.ts create mode 100644 tests/imports-test/__tests__/classes/Hello.test.ts create mode 100644 tests/imports-test/__tests__/relative-import.test.ts create mode 100644 tests/imports-test/package.json create mode 100644 tests/imports-test/src/absolute-import.ts create mode 100644 tests/imports-test/src/classes/Hello.ts create mode 100644 tests/imports-test/src/relative-import.ts create mode 100644 tests/imports-test/tsconfig.json diff --git a/tests/__tests__/import.spec.ts b/tests/__tests__/import.spec.ts new file mode 100644 index 0000000000..2fc4f53ee3 --- /dev/null +++ b/tests/__tests__/import.spec.ts @@ -0,0 +1,29 @@ +import { } from 'jest'; +import { } from 'node'; +import runJest from '../__helpers__/runJest'; + +describe('import with relative and absolute paths', () => { + + it('should run successfully', () => { + + const result = runJest('../imports-test', ['--no-cache']); + + const stderr = result.stderr.toString(); + const output = result.output.toString(); + + expect(result.status).toBe(1); + expect(output).toContain('4 failed, 4 total'); + + expect(stderr).toContain('at new Hello (src\\classes\\Hello.ts:11:11)'); + + expect(stderr).toContain('at Object. (__tests__\\classes\\Hello.test.ts:9:19)'); + expect(stderr).toContain('at Object. (__tests__\\classes\\Hello-relative.test.ts:9:19)'); + + expect(stderr).toContain('at Object.simpleFunction (src\\absolute-import.ts:4:17)'); + expect(stderr).toContain('at Object. (__tests__\\absolute-import.test.ts:8:9)'); + + expect(stderr).toContain('at Object.simpleFunction (src\\relative-import.ts:4:17)'); + expect(stderr).toContain('at Object. (__tests__\\relative-import.test.ts:8:9)'); + }); + +}); \ No newline at end of file diff --git a/tests/imports-test/__tests__/absolute-import.test.ts b/tests/imports-test/__tests__/absolute-import.test.ts new file mode 100644 index 0000000000..dd5c6d37e2 --- /dev/null +++ b/tests/imports-test/__tests__/absolute-import.test.ts @@ -0,0 +1,10 @@ +declare var jest, describe, it, expect; + +import { simpleFunction } from 'absolute-import'; + +describe('Simple function absolute', () => { + + it('should throw an error on line 11', () => { + simpleFunction(); + }); +}); \ No newline at end of file diff --git a/tests/imports-test/__tests__/classes/Hello-relative.test.ts b/tests/imports-test/__tests__/classes/Hello-relative.test.ts new file mode 100644 index 0000000000..ace25ead52 --- /dev/null +++ b/tests/imports-test/__tests__/classes/Hello-relative.test.ts @@ -0,0 +1,13 @@ +declare var jest, describe, it, expect; + +import { Hello } from '../../src/classes/Hello'; + +describe('Hello Class relative', () => { + + it('should throw an error on line 11', () => { + + const hello = new Hello(); + + }); + +}); \ No newline at end of file diff --git a/tests/imports-test/__tests__/classes/Hello.test.ts b/tests/imports-test/__tests__/classes/Hello.test.ts new file mode 100644 index 0000000000..6c988f6b95 --- /dev/null +++ b/tests/imports-test/__tests__/classes/Hello.test.ts @@ -0,0 +1,13 @@ +declare var jest, describe, it, expect; + +import { Hello } from 'classes/Hello'; + +describe('Hello Class absolute', () => { + + it('should throw an error on line 11', () => { + + const hello = new Hello(); + + }); + +}); \ No newline at end of file diff --git a/tests/imports-test/__tests__/relative-import.test.ts b/tests/imports-test/__tests__/relative-import.test.ts new file mode 100644 index 0000000000..4f9b9a2f5d --- /dev/null +++ b/tests/imports-test/__tests__/relative-import.test.ts @@ -0,0 +1,10 @@ +declare var jest, describe, it, expect; + +import { simpleFunction } from '../src/relative-import'; + +describe('Simple function relative', () => { + + it('should throw an error on line 11', () => { + simpleFunction(); + }); +}); \ No newline at end of file diff --git a/tests/imports-test/package.json b/tests/imports-test/package.json new file mode 100644 index 0000000000..a4585ceb21 --- /dev/null +++ b/tests/imports-test/package.json @@ -0,0 +1,14 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "moduleDirectories": ["node_modules", "src"], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} \ No newline at end of file diff --git a/tests/imports-test/src/absolute-import.ts b/tests/imports-test/src/absolute-import.ts new file mode 100644 index 0000000000..7272c3af74 --- /dev/null +++ b/tests/imports-test/src/absolute-import.ts @@ -0,0 +1,5 @@ +import { Hello } from 'classes/Hello'; + +export function simpleFunction() { + const hello = new Hello(); +} \ No newline at end of file diff --git a/tests/imports-test/src/classes/Hello.ts b/tests/imports-test/src/classes/Hello.ts new file mode 100644 index 0000000000..5edeb4c227 --- /dev/null +++ b/tests/imports-test/src/classes/Hello.ts @@ -0,0 +1,13 @@ +export class Hello { + constructor() { + const greeting = ` + this + is + a + multiline + greeting + `; + + throw new Error('Hello error!'); + } +} \ No newline at end of file diff --git a/tests/imports-test/src/relative-import.ts b/tests/imports-test/src/relative-import.ts new file mode 100644 index 0000000000..4300a61e81 --- /dev/null +++ b/tests/imports-test/src/relative-import.ts @@ -0,0 +1,5 @@ +import { Hello } from './classes/Hello'; + +export function simpleFunction() { + const hello = new Hello(); +} \ No newline at end of file diff --git a/tests/imports-test/tsconfig.json b/tests/imports-test/tsconfig.json new file mode 100644 index 0000000000..6a8b14571b --- /dev/null +++ b/tests/imports-test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true, + "baseUrl": "src" + } +} \ No newline at end of file From 2cabff9bb4c586b699857e658c8d6ac433832dca Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 17:54:09 +0100 Subject: [PATCH 007/256] Readme update with known tsc limitations --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10a97b1eb0..0738fff3f9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ - [Versioning](#versioning) - [Usage](#usage) - [Options](#options) + - [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options) - [How to Contribute](#how-to-contribute) - [Quickstart to run tests (only if you're working on this package)](#quickstart-to-run-tests-only-if-youre-working-on-this-package) - [License](#license) @@ -89,7 +90,16 @@ Or even declare options for `tsc` instead of using separate config, like this: } ``` For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). -> **Note:** You can't target `ES6` while using `node v4` in your test environment. + +### Known limitations for TS compiler options +- You can't use `"target": "ES6"` while using `node v4` in your test environment; +- You can't use `"react": "preserve"` for now (see [progress of this issue](https://github.com/kulshekhar/ts-jest/issues/63)); +- If you use `"baseUrl": ""`, you have also change `jest config` a little bit: +```json +"jest": { + "moduleDirectories": ["node_modules", ""] +} +``` ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From 99db9bdfb159f93688e57722eb3876f12fa96367 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Fri, 2 Dec 2016 17:59:27 +0100 Subject: [PATCH 008/256] Fix for wrong path separator for *nix --- tests/__tests__/import.spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/__tests__/import.spec.ts b/tests/__tests__/import.spec.ts index 2fc4f53ee3..ad1793ac1b 100644 --- a/tests/__tests__/import.spec.ts +++ b/tests/__tests__/import.spec.ts @@ -1,5 +1,6 @@ import { } from 'jest'; import { } from 'node'; +import * as path from 'path'; import runJest from '../__helpers__/runJest'; describe('import with relative and absolute paths', () => { @@ -14,16 +15,16 @@ describe('import with relative and absolute paths', () => { expect(result.status).toBe(1); expect(output).toContain('4 failed, 4 total'); - expect(stderr).toContain('at new Hello (src\\classes\\Hello.ts:11:11)'); + expect(stderr).toContain('at new Hello (src' + path.sep + 'classes' + path.sep + 'Hello.ts:11:11)'); - expect(stderr).toContain('at Object. (__tests__\\classes\\Hello.test.ts:9:19)'); - expect(stderr).toContain('at Object. (__tests__\\classes\\Hello-relative.test.ts:9:19)'); + expect(stderr).toContain('at Object. (__tests__' + path.sep + 'classes' + path.sep + 'Hello.test.ts:9:19)'); + expect(stderr).toContain('at Object. (__tests__' + path.sep + 'classes' + path.sep + 'Hello-relative.test.ts:9:19)'); - expect(stderr).toContain('at Object.simpleFunction (src\\absolute-import.ts:4:17)'); - expect(stderr).toContain('at Object. (__tests__\\absolute-import.test.ts:8:9)'); + expect(stderr).toContain('at Object.simpleFunction (src' + path.sep + 'absolute-import.ts:4:17)'); + expect(stderr).toContain('at Object. (__tests__' + path.sep + 'absolute-import.test.ts:8:9)'); - expect(stderr).toContain('at Object.simpleFunction (src\\relative-import.ts:4:17)'); - expect(stderr).toContain('at Object. (__tests__\\relative-import.test.ts:8:9)'); + expect(stderr).toContain('at Object.simpleFunction (src' + path.sep + 'relative-import.ts:4:17)'); + expect(stderr).toContain('at Object. (__tests__' + path.sep + 'relative-import.test.ts:8:9)'); }); }); \ No newline at end of file From f55a28fe66058e81b183d18394800fd1e122adaa Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 3 Dec 2016 01:39:29 +0530 Subject: [PATCH 009/256] Fix appveyor badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10a97b1eb0..3c382425cd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](https://travis-ci.org/kulshekhar/ts-jest) -[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb?svg=true)](https://ci.appveyor.com/project/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) [![dependencies](https://david-dm.org/kulshekhar/ts-jest.svg)](https://www.npmjs.com/package/ts-jest) From c65baed954faa483943afd46e2880ef93a858f64 Mon Sep 17 00:00:00 2001 From: Igor Chulinda Date: Mon, 5 Dec 2016 17:18:45 +0100 Subject: [PATCH 010/256] Small fix for readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12c8302e9d..e2554b1688 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ For all available options see [TypeScript docs](https://www.typescriptlang.org/d ### Known limitations for TS compiler options - You can't use `"target": "ES6"` while using `node v4` in your test environment; - You can't use `"react": "preserve"` for now (see [progress of this issue](https://github.com/kulshekhar/ts-jest/issues/63)); -- If you use `"baseUrl": ""`, you have also change `jest config` a little bit: +- If you use `"baseUrl": ""`, you also have to change `jest config` a little bit: ```json "jest": { "moduleDirectories": ["node_modules", ""] From 57173cd95d24f13b3e728fadac8b0eb63731391e Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 7 Dec 2016 19:19:28 +0530 Subject: [PATCH 011/256] Update AUTHORS Adding @ericanderson and @bgoscinski --- AUTHORS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index 311a69ae54..e7b7f2d921 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,6 +3,8 @@ # # Name/Organization +Bartosz Gościński +Eric Anderson Ihor Chulinda Kulshekhar Kabra OJ Kwon From d615b7c4e39d86a66e4c2ab8a9341b9ef3c615c6 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 22 Dec 2016 21:51:25 +0530 Subject: [PATCH 012/256] Don't use `latest` as version for jest --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84fd4b286d..fd6292b8d1 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "tslint": "next", "react": "latest", "react-test-renderer": "latest", - "jest": "latest", + "jest": "^17.0.0", "ts-jest": "latest", "cross-spawn": "latest", "cross-spawn-with-kill": "latest", From 649c2fc4a5c9f4e6848a8677ba3d566f90cd8fda Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 22 Dec 2016 22:03:13 +0530 Subject: [PATCH 013/256] Disable tests for watch mode --- scripts/tests.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/tests.js b/scripts/tests.js index b5714207ea..01be52200b 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -8,17 +8,17 @@ const fs = require('fs'); const path = require('path'); function dirExists(dirPath) { - const F_OK = fs.constants && fs.constants.F_OK || fs['F_OK']; - try { - fs.accessSync(dirPath, F_OK); - return fs.statSync(dirPath).isDirectory(); - } catch (e) { - return false; - } + const F_OK = fs.constants && fs.constants.F_OK || fs['F_OK']; + try { + fs.accessSync(dirPath, F_OK); + return fs.statSync(dirPath).isDirectory(); + } catch (e) { + return false; + } } function getDirectories(rootDir) { - return fs.readdirSync(rootDir).filter(function(file) { + return fs.readdirSync(rootDir).filter(function (file) { return fs.statSync(path.join(rootDir, file)).isDirectory(); }); } @@ -26,14 +26,14 @@ function getDirectories(rootDir) { function createIntegrationMock() { const integrationMockContent = 'module.exports = require(\'../../../\');'; const testsRoot = 'tests'; - const testCaseFolders = getDirectories(testsRoot).filter(function(testDir) { + const testCaseFolders = getDirectories(testsRoot).filter(function (testDir) { return !(testDir.startsWith('__') && testDir.endsWith('__')); }); for (let i = 0; i < testCaseFolders.length; i++) { const testCaseModuleFolder = path.join(testsRoot, testCaseFolders[i], 'node_modules'); if (!dirExists(testCaseModuleFolder)) { fs.mkdirSync(testCaseModuleFolder); - const integrationMockPath = path.join(testCaseModuleFolder, 'ts-jest.js'); + const integrationMockPath = path.join(testCaseModuleFolder, 'ts-jest.js'); fs.appendFileSync(integrationMockPath, integrationMockContent); } } @@ -50,8 +50,7 @@ if (!process.env.CI) { // omit tests for watch cases if it runned on AppVeyor due to this issues: // https://github.com/kulshekhar/ts-jest/issues/53 // http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem -if (process.env.AppVeyor) { - argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); -} + +argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); jest.run(argv); From 5c6359b36ccd49df63ed486a067e958093e77896 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 22 Dec 2016 23:27:07 +0530 Subject: [PATCH 014/256] Disable async tests --- scripts/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests.js b/scripts/tests.js index 01be52200b..550a7c9ab8 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -51,6 +51,6 @@ if (!process.env.CI) { // https://github.com/kulshekhar/ts-jest/issues/53 // http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem -argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); +argv.push('--testPathPattern', '^(?!(.*(watch|async)\.spec\.ts$)).*'); jest.run(argv); From 0afb157755baa5ee8c57921c0b16f3cb184e7cd8 Mon Sep 17 00:00:00 2001 From: Maxim Samoilov Date: Fri, 23 Dec 2016 13:59:08 +0700 Subject: [PATCH 015/256] Update for jest@18 (#83) * Return modified results in testResultsProcessor to fix working with jest@18 #83 See jest@18 changelog: > The testResultsProcessor function is now required to return the modified results. https://github.com/facebook/jest/blob/b0396be/CHANGELOG.md * Mock all files in files fixtures #83 * Remove node_modules from fixtures because they are created by script #83 * Add types for lodash functions #83 * Fix getting coverage for jest@18 #83 * Disable tests for watch mode * Update required Jest version to ^18.0.0 --- package.json | 27 +++++++++------- scripts/tests.js | 26 ++++++++++++--- src/coverageprocessor.ts | 37 +++++++++++++++++----- src/utils.ts | 2 +- tests/button/node_modules/ts-jest.js | 1 - tests/simple-async/node_modules/ts-jest.js | 1 - tests/simple/node_modules/ts-jest.js | 1 - tests/use-strict/node_modules/ts-jest.js | 1 - tests/watch-test/node_modules/ts-jest.js | 1 - 9 files changed, 67 insertions(+), 30 deletions(-) delete mode 100644 tests/button/node_modules/ts-jest.js delete mode 100644 tests/simple-async/node_modules/ts-jest.js delete mode 100644 tests/simple/node_modules/ts-jest.js delete mode 100644 tests/use-strict/node_modules/ts-jest.js delete mode 100644 tests/watch-test/node_modules/ts-jest.js diff --git a/package.json b/package.json index fd6292b8d1..2e20f08c2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "17.0.3", + "version": "18.0.0", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", @@ -60,29 +60,34 @@ "lodash.assign": "^4.2.0", "lodash.includes": "^4.3.0", "lodash.partition": "^4.6.0", + "lodash.pickby": "^4.6.0", "remap-istanbul": "^0.7.0", "source-map-support": "^0.4.4", "yargs": "^6.1.1" }, "peerDependencies": { "typescript": "^2.0.6 || ^2.1.0-dev || ^2.2.0-dev", - "jest": "~17.0.0" + "jest": "~18.0.0" }, "devDependencies": { "@types/es6-shim": "latest", "@types/jest": "latest", + "@types/lodash.assign": "latest", + "@types/lodash.includes": "latest", + "@types/lodash.partition": "latest", + "@types/lodash.pickby": "latest", + "@types/node": "latest", "@types/react": "latest", "@types/source-map-support": "latest", - "@types/node": "latest", - "typescript": "next", - "tslint": "next", - "react": "latest", - "react-test-renderer": "latest", - "jest": "^17.0.0", - "ts-jest": "latest", "cross-spawn": "latest", "cross-spawn-with-kill": "latest", + "doctoc": "latest", + "jest": "^18.0.0", + "react": "latest", + "react-test-renderer": "latest", "rimraf": "latest", - "doctoc": "latest" + "ts-jest": "latest", + "tslint": "next", + "typescript": "next" } -} \ No newline at end of file +} diff --git a/scripts/tests.js b/scripts/tests.js index 550a7c9ab8..d391c2312a 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -23,18 +23,34 @@ function getDirectories(rootDir) { }); } +function getFiles(rootDir) { + return fs.readdirSync(rootDir).filter(function (file) { + return !fs.statSync(path.join(rootDir, file)).isDirectory(); + }); +} + +function getIntegrationMockContent(file) { + return `module.exports = require('../../../../${file}');`; +} + function createIntegrationMock() { - const integrationMockContent = 'module.exports = require(\'../../../\');'; const testsRoot = 'tests'; const testCaseFolders = getDirectories(testsRoot).filter(function (testDir) { return !(testDir.startsWith('__') && testDir.endsWith('__')); }); + const filesToMock = getFiles('dist').filter(function (fileName) { + return fileName.endsWith('.js') + }) for (let i = 0; i < testCaseFolders.length; i++) { - const testCaseModuleFolder = path.join(testsRoot, testCaseFolders[i], 'node_modules'); - if (!dirExists(testCaseModuleFolder)) { + const testCaseNodeModules = path.join(testsRoot, testCaseFolders[i], 'node_modules'); + if (!dirExists(testCaseNodeModules)) { + fs.mkdirSync(testCaseNodeModules); + const testCaseModuleFolder = path.join(testCaseNodeModules, 'ts-jest') fs.mkdirSync(testCaseModuleFolder); - const integrationMockPath = path.join(testCaseModuleFolder, 'ts-jest.js'); - fs.appendFileSync(integrationMockPath, integrationMockContent); + filesToMock.forEach(function (fileName) { + const integrationMockPath = path.join(testCaseModuleFolder, fileName); + fs.appendFileSync(integrationMockPath, getIntegrationMockContent(fileName)); + }) } } } diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 4861751289..e355e67573 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -1,21 +1,41 @@ -declare const global: any; +declare const global: { + __ts_coverage__cache__: { + coverageConfig: any; + sourceCache: any[]; + coverageCollectFiles: any[]; + } +} import * as path from 'path'; -const includes = require('lodash.includes'); -const partition = require('lodash.partition'); +import includes = require('lodash.includes'); +import partition = require('lodash.partition'); const loadCoverage = require('remap-istanbul/lib/loadCoverage'); const remap = require('remap-istanbul/lib/remap'); const writeReport = require('remap-istanbul/lib/writeReport'); const istanbulInstrument = require('istanbul-lib-instrument'); +import pickBy = require('lodash.pickby') + +interface CoverageMap { + merge: (data: Object) => void; + getCoverageSummary: () => Object; + data: Object; + addFileCoverage: (fileCoverage: Object) => void; +} -function processResult(result: any): void { - if (!global.__ts_coverage__cache__) return; +// full type https://github.com/facebook/jest/blob/master/types/TestResult.js +interface Result { + coverageMap: CoverageMap; +} + +function processResult(result: Result): Result { + if (!global.__ts_coverage__cache__) return result; const { coverageConfig, sourceCache, coverageCollectFiles } = global.__ts_coverage__cache__; - if (!coverageConfig.collectCoverage) return; + if (!coverageConfig.collectCoverage) return result; + + const coveredFiles = Object.keys(sourceCache) + const coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))] - const coverage = result.testResults.map(value => value.coverage); - const coveredFiles = coverage.reduce((acc, x) => x ? acc.concat(Object.keys(x)) : acc, []); const uncoveredFiles = partition(coverageCollectFiles, x => includes(coveredFiles, x))[1]; const coverageOutputPath = path.join(coverageConfig.coverageDirectory || 'coverage', 'remapped'); @@ -45,6 +65,7 @@ function processResult(result: any): void { writeReport(coverageCollector, 'lcovonly', {}, path.join(coverageOutputPath, 'lcov.info')); writeReport(coverageCollector, 'json', {}, path.join(coverageOutputPath, 'coverage.json')); writeReport(coverageCollector, 'text', {}, path.join(coverageOutputPath, 'coverage.txt')); + return result; } module.exports = processResult; \ No newline at end of file diff --git a/src/utils.ts b/src/utils.ts index 6706e97d4e..485865494d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,7 +2,7 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; -const assign = require('lodash.assign'); +import assign = require('lodash.assign'); const normalize = require('jest-config').normalize; const setFromArgv = require('jest-config/build/setFromArgv'); diff --git a/tests/button/node_modules/ts-jest.js b/tests/button/node_modules/ts-jest.js deleted file mode 100644 index 6bb2ded8c1..0000000000 --- a/tests/button/node_modules/ts-jest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../'); \ No newline at end of file diff --git a/tests/simple-async/node_modules/ts-jest.js b/tests/simple-async/node_modules/ts-jest.js deleted file mode 100644 index 6bb2ded8c1..0000000000 --- a/tests/simple-async/node_modules/ts-jest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../'); \ No newline at end of file diff --git a/tests/simple/node_modules/ts-jest.js b/tests/simple/node_modules/ts-jest.js deleted file mode 100644 index 6bb2ded8c1..0000000000 --- a/tests/simple/node_modules/ts-jest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../'); \ No newline at end of file diff --git a/tests/use-strict/node_modules/ts-jest.js b/tests/use-strict/node_modules/ts-jest.js deleted file mode 100644 index 6bb2ded8c1..0000000000 --- a/tests/use-strict/node_modules/ts-jest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../'); \ No newline at end of file diff --git a/tests/watch-test/node_modules/ts-jest.js b/tests/watch-test/node_modules/ts-jest.js deleted file mode 100644 index 6bb2ded8c1..0000000000 --- a/tests/watch-test/node_modules/ts-jest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../'); \ No newline at end of file From 19845589e1d1921169680e54a57e0d409e15b4bc Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 23 Dec 2016 13:20:26 +0530 Subject: [PATCH 016/256] Update AUTHORS add @Nitive to the authors list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index e7b7f2d921..190f019788 100644 --- a/AUTHORS +++ b/AUTHORS @@ -7,4 +7,5 @@ Bartosz Gościński Eric Anderson Ihor Chulinda Kulshekhar Kabra +Maxim Samoilov OJ Kwon From 875b8c96eab7b166f934ebe63c3557f5af31b6b0 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Thu, 29 Dec 2016 11:47:23 -0800 Subject: [PATCH 017/256] Relax peer dependency version range on Jest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jest's current version is 18.1, and by specifying a version range of `~18.0.0` we preclude using that even though it's fine: ``` └── UNMET PEER DEPENDENCY jest@18.1.0 npm ERR! peer dep missing: jest@~18.0.0, required by ts-jest@18.0.0 npm ERR! code 1 ``` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e20f08c2a..05ddf5cae0 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ }, "peerDependencies": { "typescript": "^2.0.6 || ^2.1.0-dev || ^2.2.0-dev", - "jest": "~18.0.0" + "jest": "^18.0.0" }, "devDependencies": { "@types/es6-shim": "latest", From cc5e34732a9081baaa90252a09f08692b29e39e5 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 30 Dec 2016 11:46:10 +0530 Subject: [PATCH 018/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 05ddf5cae0..c075800c1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "18.0.0", + "version": "18.0.1", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 2f275a1fa19b95b64b89342ef7cead320b78228e Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 31 Dec 2016 01:28:33 +0530 Subject: [PATCH 019/256] Update AUTHORS add @pelotom to the authors list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 190f019788..333208a242 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Ihor Chulinda Kulshekhar Kabra Maxim Samoilov OJ Kwon +Tom Crockett From a9f353224ea1099164ef302b3c8ba643f3a174cc Mon Sep 17 00:00:00 2001 From: Felipe Matos Date: Wed, 4 Jan 2017 20:37:12 -0300 Subject: [PATCH 020/256] Add installation steps for React Native in README https://github.com/kulshekhar/ts-jest/issues/92 --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index e2554b1688..9a01f808a1 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,32 @@ By default `jest` does not provide code coverage remapping for transpiled codes, > **Note:** If you're experiencing remapping failure with source lookup, it may due to pre-created cache from `jest`. It can be manually deleted, or execute with [`--no-cache`](https://facebook.github.io/jest/docs/troubleshooting.html#caching-issues) to not use those. +### React Native + +There is a few additional steps if you want to use it with React Native. + +Install `babel-jest` and `babel-preset-react-native` modules. + +```sh +npm install -D babel-jest babel-preset-react-native +``` + +Ensure `.babelrc` contains: + +```json +{ + "presets": ["react-native"] +} +``` + +In `package.json`, inside `jest` section, the `transform` should be like this: +```json +"transform": { + "^.+\\.js$": "/node_modules/babel-jest", + ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" +} +``` + ## Options By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: From 25aae66c664e291f4da7c44526ec79c353b50c5c Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 6 Jan 2017 06:35:34 +0530 Subject: [PATCH 021/256] Update AUTHORS Add @fmatoss to the authors list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 333208a242..b59c50f567 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,7 @@ Bartosz Gościński Eric Anderson +Felipe Matos Ihor Chulinda Kulshekhar Kabra Maxim Samoilov From f910ca8f1276631a7cae7dff726f65e50337222b Mon Sep 17 00:00:00 2001 From: Emil Persson Date: Tue, 17 Jan 2017 21:23:29 +0100 Subject: [PATCH 022/256] Add ability to resolve "extends" directive in tsconfig.json --- src/utils.ts | 11 +++++-- tests/__tests__/tsconfig-string.spec.ts | 33 ++++++++++++++++++- tests/__ts-jest-mocks__/path.ts | 12 ++++--- tests/tsconfig-test/extends-tsconfig.json | 3 ++ .../extends-with-overrides-tsconfig.json | 7 ++++ 5 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 tests/tsconfig-test/extends-tsconfig.json create mode 100644 tests/tsconfig-test/extends-with-overrides-tsconfig.json diff --git a/src/utils.ts b/src/utils.ts index 485865494d..3f6da23d6a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -73,7 +73,14 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config = 'tsconfig.json'; } if (typeof config === 'string') { - config = require(path.resolve(config)).compilerOptions; + const configPath = path.resolve(config); + const external = require(configPath); + config = external.compilerOptions || {}; + + if (typeof external.extends === 'string') { + const parentConfigPath = path.join(path.dirname(configPath), external.extends); + config = Object.assign({}, require(parentConfigPath).compilerOptions, config); + } } config.module = config.module || tsc.ModuleKind.CommonJS; config.jsx = config.jsx || tsc.JsxEmit.React; @@ -89,4 +96,4 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { } return tsc.convertCompilerOptionsFromJson(config, undefined).options; -} \ No newline at end of file +} diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index fccc4fb621..4cf6de6289 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -52,4 +52,35 @@ describe('get ts config from string', () => { }); }); -}); \ No newline at end of file + it('should correctly resolve the "extends" directive', () => { + const {getTSConfig} = require('../../src/utils'); + const result = getTSConfig({ + '__TS_CONFIG__': 'extends-tsconfig.json' + }); + + expect(result).toEqual ({ + 'target': 2, + 'module': 1, + 'moduleResolution': 2, + 'noEmitOnError': true, + 'jsx': 2 + }); + }); + + it('should correctly override any config in the "extends" directive', () => { + const {getTSConfig} = require('../../src/utils'); + const result = getTSConfig({ + '__TS_CONFIG__': 'extends-with-overrides-tsconfig.json' + }); + + expect(result).toEqual ({ + 'target': 1, + 'module': 1, + 'moduleResolution': 2, + 'noEmitOnError': true, + 'jsx': 2, + 'noImplicitAny': true + }); + }); + +}); diff --git a/tests/__ts-jest-mocks__/path.ts b/tests/__ts-jest-mocks__/path.ts index f3ad8e7735..9a3474b60a 100644 --- a/tests/__ts-jest-mocks__/path.ts +++ b/tests/__ts-jest-mocks__/path.ts @@ -3,7 +3,9 @@ import { } from 'node'; interface MockedPath { __setBaseDir(newBaseDir); - resolve(args); + resolve(...args); + dirname(...args); + join(...args); } const path = require.requireActual('path'); @@ -19,11 +21,13 @@ function __setBaseDir(newBaseDir) { // A custom version of `readdirSync` that reads from the special mocked out // file list set via __setMockFiles -function resolve(args) { - return path.resolve(baseDir, args); +function resolve(...args) { + return path.resolve(baseDir, ...args); } mockedPath.__setBaseDir = __setBaseDir; mockedPath.resolve = resolve; +mockedPath.dirname = path.dirname; +mockedPath.join = path.join; -module.exports = mockedPath; \ No newline at end of file +module.exports = mockedPath; diff --git a/tests/tsconfig-test/extends-tsconfig.json b/tests/tsconfig-test/extends-tsconfig.json new file mode 100644 index 0000000000..d0251e982d --- /dev/null +++ b/tests/tsconfig-test/extends-tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./my-tsconfig.json" +} diff --git a/tests/tsconfig-test/extends-with-overrides-tsconfig.json b/tests/tsconfig-test/extends-with-overrides-tsconfig.json new file mode 100644 index 0000000000..8b6bfd641e --- /dev/null +++ b/tests/tsconfig-test/extends-with-overrides-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "./my-tsconfig.json", + "compilerOptions": { + "target": "ES5", + "noImplicitAny": true + } +} From 50495c4d249a5df339fd86a894792f6570bfa4b1 Mon Sep 17 00:00:00 2001 From: Emil Persson Date: Wed, 18 Jan 2017 07:47:19 +0100 Subject: [PATCH 023/256] Change from CompilerOptions numbers to TS enum constants --- package.json | 3 +- tests/__tests__/tsconfig-default.spec.ts | 23 ++++++++------- tests/__tests__/tsconfig-inline.spec.ts | 23 ++++++++------- tests/__tests__/tsconfig-string.spec.ts | 37 ++++++++++++------------ 4 files changed, 45 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index c075800c1f..5fe77ba61e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "author": "Kulshekhar Kabra (https://github.com/kulshekhar)", "contributors": [ "Ihor Chulinda (https://github.com/Igmat)", - "OJ Kwon (https://github.com/kwonoj)" + "OJ Kwon (https://github.com/kwonoj)", + "Emil Persson (https://github.com/emilniklas)" ], "license": "MIT", "bugs": { diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index cfab95e2af..ec71226e2e 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -1,5 +1,6 @@ import { } from 'jest'; import { } from 'node'; +import * as ts from 'typescript' jest.mock('path'); @@ -15,11 +16,11 @@ describe('get default ts config', () => { const result = getTSConfig(); expect(result).toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': false, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -28,11 +29,11 @@ describe('get default ts config', () => { const result = getTSConfig(); expect(result).not.toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': true, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -41,8 +42,8 @@ describe('get default ts config', () => { const result = getTSConfig(); expect(result).not.toEqual ({ - 'module': 1, - 'jsx': 2 + 'module': ts.ModuleKind.CommonJS, + 'jsx': ts.JsxEmit.React }); }); @@ -62,4 +63,4 @@ describe('get default ts config', () => { expect(result).toEqual(resultNullContent); }); -}); \ No newline at end of file +}); diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index fe8b6a7fea..d7b6e8c285 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -1,5 +1,6 @@ import { } from 'jest'; import { } from 'node'; +import * as ts from 'typescript'; jest.mock('path'); @@ -20,8 +21,8 @@ describe('get inline ts config', () => { }); expect(result).toEqual ({ - 'module': 1, - 'jsx': 2 + 'module': ts.ModuleKind.CommonJS, + 'jsx': ts.JsxEmit.React }); }); @@ -35,11 +36,11 @@ describe('get inline ts config', () => { }); expect(result).not.toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': false, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -53,12 +54,12 @@ describe('get inline ts config', () => { }); expect(result).not.toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': true, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); -}); \ No newline at end of file +}); diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index 4cf6de6289..519ff1012f 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -1,5 +1,6 @@ import { } from 'jest'; import { } from 'node'; +import * as ts from 'typescript'; jest.mock('path'); @@ -17,11 +18,11 @@ describe('get ts config from string', () => { }); expect(result).toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': true, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -32,11 +33,11 @@ describe('get ts config from string', () => { }); expect(result).not.toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': false, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -47,8 +48,8 @@ describe('get ts config from string', () => { }); expect(result).not.toEqual ({ - 'module': 1, - 'jsx': 2 + 'target': ts.ScriptTarget.ES5, + 'jsx': ts.JsxEmit.React }); }); @@ -59,11 +60,11 @@ describe('get ts config from string', () => { }); expect(result).toEqual ({ - 'target': 2, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': true, - 'jsx': 2 + 'jsx': ts.JsxEmit.React }); }); @@ -74,11 +75,11 @@ describe('get ts config from string', () => { }); expect(result).toEqual ({ - 'target': 1, - 'module': 1, - 'moduleResolution': 2, + 'target': ts.ScriptTarget.ES5, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, 'noEmitOnError': true, - 'jsx': 2, + 'jsx': ts.JsxEmit.React, 'noImplicitAny': true }); }); From d7665e77c0e1c34345f4c0b3f1bb11b9d9f88ae4 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 25 Jan 2017 20:46:06 +0530 Subject: [PATCH 024/256] Bump package version to publish changes merged in #98 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5fe77ba61e..ec720a9868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "18.0.1", + "version": "18.0.2", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From f5ab7718edcd19b82d0c56d35e578f6b5ad766ac Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 27 Jan 2017 11:32:35 +0530 Subject: [PATCH 025/256] Update AUTHORS Add @emilniklas to the list of authors --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index b59c50f567..0f248ad284 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ # Name/Organization Bartosz Gościński +Emil Persson Eric Anderson Felipe Matos Ihor Chulinda From ac853f237492c7e97d9298768e90a97c933a4b78 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 31 Jan 2017 12:17:12 +0530 Subject: [PATCH 026/256] check watch limit on travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index da21fb2e88..7cb7d75324 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,7 @@ node_js: - "4" before_install: - npm i -g npm@latest + - echo '>>>>>>>>>>' + - sysctl fs.inotify.max_user_watches sudo: false From 3147ed17a4eef7723c22347e80537c58c2fca960 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 31 Jan 2017 12:19:58 +0530 Subject: [PATCH 027/256] set watch limit --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7cb7d75324..b05b4d8ba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,7 @@ before_install: - npm i -g npm@latest - echo '>>>>>>>>>>' - sysctl fs.inotify.max_user_watches + - sudo sysctl fs.inotify.max_user_watches=524288 + - sysctl fs.inotify.max_user_watches -sudo: false +sudo: required From a9d0278dc37eec853683f4ff9889b9cdf7484c27 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 31 Jan 2017 12:22:44 +0530 Subject: [PATCH 028/256] Remove debug statements --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b05b4d8ba9..f8ef68935e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,6 @@ node_js: - "4" before_install: - npm i -g npm@latest - - echo '>>>>>>>>>>' - - sysctl fs.inotify.max_user_watches - sudo sysctl fs.inotify.max_user_watches=524288 - - sysctl fs.inotify.max_user_watches sudo: required From 281f99152bf17eaee4b55c2415ababb90a54403b Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 1 Feb 2017 01:23:15 +0530 Subject: [PATCH 029/256] Enable async tests for travis --- scripts/tests.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tests.js b/scripts/tests.js index d391c2312a..38a16064e4 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -66,7 +66,8 @@ if (!process.env.CI) { // omit tests for watch cases if it runned on AppVeyor due to this issues: // https://github.com/kulshekhar/ts-jest/issues/53 // http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem - -argv.push('--testPathPattern', '^(?!(.*(watch|async)\.spec\.ts$)).*'); +if (process.env.AppVeyor) { + argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); +} jest.run(argv); From d1d8a8adc12c1d6e2e0f80a3172a206664624803 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 1 Feb 2017 01:28:39 +0530 Subject: [PATCH 030/256] disable tests that watch --- scripts/tests.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/tests.js b/scripts/tests.js index 38a16064e4..75b263239d 100644 --- a/scripts/tests.js +++ b/scripts/tests.js @@ -66,8 +66,7 @@ if (!process.env.CI) { // omit tests for watch cases if it runned on AppVeyor due to this issues: // https://github.com/kulshekhar/ts-jest/issues/53 // http://help.appveyor.com/discussions/problems/5500-nodejs-child-process-with-watch-and-stderr-problem -if (process.env.AppVeyor) { - argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); -} + +argv.push('--testPathPattern', '^(?!(.*watch\.spec\.ts$)).*'); jest.run(argv); From 50a3707c69c9e1d3c7565d97a6eacb8646aeef19 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Sat, 4 Feb 2017 21:09:05 -0800 Subject: [PATCH 031/256] Add dependencies on `jest-util` and `jest-config` --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index ec720a9868..1c879093d0 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,8 @@ "dependencies": { "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", + "jest-config": "^18.1.0", + "jest-util": "^18.1.0", "lodash.assign": "^4.2.0", "lodash.includes": "^4.3.0", "lodash.partition": "^4.6.0", From cb88ba9c024756e73e865e704585580ef049a67d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sun, 5 Feb 2017 11:16:50 +0530 Subject: [PATCH 032/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c879093d0..3af6ede607 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "18.0.2", + "version": "18.0.3", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 04a3999556c5dd9784741b61cd07a73998b874d7 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Mon, 6 Feb 2017 11:07:46 +0530 Subject: [PATCH 033/256] Update Authors Add @blakeembrey to the Author's list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 0f248ad284..08e6f5e2bb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ # Name/Organization Bartosz Gościński +Blake Embrey Emil Persson Eric Anderson Felipe Matos From 7b46827e35268124a41f798b4a10dd74638605bf Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 21 Feb 2017 23:51:35 +0530 Subject: [PATCH 034/256] Upgrade jest version --- package.json | 17 ++++++++--------- src/coverageprocessor.ts | 6 +++--- src/preprocessor.ts | 5 +++-- src/utils.ts | 2 +- tests/{__ts-jest-mocks__ => __mocks__}/path.ts | 0 tests/__tests__/jestconfig-json.spec.ts | 10 ++++++++-- tests/__tests__/jestconfig-package.spec.ts | 10 ++++++++-- tests/__tests__/use-strict.spec.ts | 2 +- .../__snapshots__/Button.test.tsx.snap | 7 +++++-- tests/simple/Hello.ts | 6 +++--- tests/simple/__tests__/Hello.test.ts | 2 +- tests/simple/package.json | 4 +++- tests/use-strict/__tests__/Strict-valid.test.ts | 2 +- 13 files changed, 45 insertions(+), 28 deletions(-) rename tests/{__ts-jest-mocks__ => __mocks__}/path.ts (100%) diff --git a/package.json b/package.json index 3af6ede607..b25df89592 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "18.0.3", + "version": "19.0.0", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", @@ -40,7 +40,6 @@ "transform": { ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" }, - "mocksPattern": "__ts-jest-mocks__", "testRegex": "/__tests__/.*\\.(spec)\\.(ts|js)$", "coverageReporters": [ "text" @@ -58,8 +57,8 @@ "dependencies": { "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", - "jest-config": "^18.1.0", - "jest-util": "^18.1.0", + "jest-config": "^19.0.0", + "jest-util": "^19.0.0", "lodash.assign": "^4.2.0", "lodash.includes": "^4.3.0", "lodash.partition": "^4.6.0", @@ -69,8 +68,8 @@ "yargs": "^6.1.1" }, "peerDependencies": { - "typescript": "^2.0.6 || ^2.1.0-dev || ^2.2.0-dev", - "jest": "^18.0.0" + "typescript": "^2.1.0 || ^2.2.0-dev", + "jest": "^19.0.0" }, "devDependencies": { "@types/es6-shim": "latest", @@ -85,12 +84,12 @@ "cross-spawn": "latest", "cross-spawn-with-kill": "latest", "doctoc": "latest", - "jest": "^18.0.0", + "jest": "^19.0.0", "react": "latest", "react-test-renderer": "latest", "rimraf": "latest", "ts-jest": "latest", "tslint": "next", - "typescript": "next" + "typescript": "latest" } -} +} \ No newline at end of file diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index e355e67573..1bb9bd4e2a 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -44,9 +44,9 @@ function processResult(result: Result): Result { const emptyCoverage = uncoveredFiles.map(x => { var ret = {}; if (sourceCache[x]) { - var instrumenter = istanbulInstrument.createInstrumenter(); - instrumenter.instrumentSync(sourceCache[x], x); - ret[x] = instrumenter.fileCoverage; + var instrumenter = istanbulInstrument.createInstrumenter(); + instrumenter.instrumentSync(sourceCache[x], x); + ret[x] = instrumenter.fileCoverage; } return ret; }); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 0146a23990..7e1025a436 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -8,14 +8,15 @@ const getPackageRoot = require('jest-util').getPackageRoot; declare const global: any; const root = getPackageRoot(); +const jestConfig = getJestConfig(root); +const { collectCoverage } = jestConfig; const { testRegex, - collectCoverage, coverageDirectory, coverageReporters, collectCoverageFrom, testResultsProcessor -} = getJestConfig(root); +} = jestConfig.config; //setting up cache to global object to resultprocessor consume if (testResultsProcessor) { diff --git a/src/utils.ts b/src/utils.ts index 3f6da23d6a..71f271020b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -21,7 +21,7 @@ function loadJestConfigFromFile(filePath, argv) { config.rootDir = config.rootDir ? path.resolve(path.dirname(filePath), config.rootDir) : process.cwd(); - return normalize(config, argv); + return normalize(config, argv); } function loadJestConfigFromPackage(filePath, argv) { diff --git a/tests/__ts-jest-mocks__/path.ts b/tests/__mocks__/path.ts similarity index 100% rename from tests/__ts-jest-mocks__/path.ts rename to tests/__mocks__/path.ts diff --git a/tests/__tests__/jestconfig-json.spec.ts b/tests/__tests__/jestconfig-json.spec.ts index f7a77d521d..23235f9b88 100644 --- a/tests/__tests__/jestconfig-json.spec.ts +++ b/tests/__tests__/jestconfig-json.spec.ts @@ -20,7 +20,10 @@ describe('get json jest config', () => { } }); - const { collectCoverage, coverageReporters, coverageDirectory, collectCoverageFrom} = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(getPackageRoot()); + + const { collectCoverage } = jestConfig; + const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; expect(collectCoverage).toBeUndefined(); expect(coverageReporters).toEqual(['html', 'json', 'text']); @@ -38,7 +41,10 @@ describe('get json jest config', () => { } }); - const { collectCoverage, coverageReporters, coverageDirectory, collectCoverageFrom} = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(getPackageRoot()); + + const { collectCoverage } = jestConfig; + const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; expect(collectCoverage).toBeTruthy(); expect(coverageReporters).toEqual(['html', 'json', 'text']); diff --git a/tests/__tests__/jestconfig-package.spec.ts b/tests/__tests__/jestconfig-package.spec.ts index bbbb0472c9..3a3547bf39 100644 --- a/tests/__tests__/jestconfig-package.spec.ts +++ b/tests/__tests__/jestconfig-package.spec.ts @@ -19,7 +19,10 @@ describe('get package json config', () => { } }); - const { collectCoverage, coverageReporters, collectCoverageFrom} = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(getPackageRoot()); + + const { collectCoverage } = jestConfig; + const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; expect(collectCoverage).toBeUndefined(); expect(coverageReporters).toEqual(['text']); @@ -35,7 +38,10 @@ describe('get package json config', () => { } }); - const { collectCoverage, coverageReporters, collectCoverageFrom} = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(getPackageRoot()); + + const { collectCoverage } = jestConfig; + const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; expect(collectCoverage).toBeTruthy(); expect(coverageReporters).toEqual(['text']); diff --git a/tests/__tests__/use-strict.spec.ts b/tests/__tests__/use-strict.spec.ts index c32a743be5..4cfcc0403f 100644 --- a/tests/__tests__/use-strict.spec.ts +++ b/tests/__tests__/use-strict.spec.ts @@ -18,7 +18,7 @@ describe('use strict', () => { it('should work with "use strict"', () => { - const result = runJest('../use-strict', ['--no-cache', '-t', 'Valid Strict']); + const result = runJest('../use-strict', ['--no-cache', '-t', 'Strict1']); expect(result.status).toBe(0); diff --git a/tests/button/__tests__/__snapshots__/Button.test.tsx.snap b/tests/button/__tests__/__snapshots__/Button.test.tsx.snap index 72c2af7af3..7b18c26c11 100644 --- a/tests/button/__tests__/__snapshots__/Button.test.tsx.snap +++ b/tests/button/__tests__/__snapshots__/Button.test.tsx.snap @@ -1,6 +1,9 @@ -exports[`test Button renders correctly 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Button renders correctly 1`] = `
+ className="button" +> hi!
`; diff --git a/tests/simple/Hello.ts b/tests/simple/Hello.ts index 1f497bce4b..c2dfee9115 100644 --- a/tests/simple/Hello.ts +++ b/tests/simple/Hello.ts @@ -13,11 +13,11 @@ export class Hello { throw new Error('Hello error!'); } - public unexcuted(action: () => void = () => {}): void { + public unexcuted(action: () => void = () => { }): void { if (action) { - action(); + action(); } else { - console.log('unexcuted'); + console.log('unexcuted'); } } } \ No newline at end of file diff --git a/tests/simple/__tests__/Hello.test.ts b/tests/simple/__tests__/Hello.test.ts index b562d489c9..e3038e335e 100644 --- a/tests/simple/__tests__/Hello.test.ts +++ b/tests/simple/__tests__/Hello.test.ts @@ -1,6 +1,6 @@ declare var jest, describe, it, expect; -import {Hello} from '../Hello'; +import { Hello } from '../Hello'; describe('Hello Class', () => { diff --git a/tests/simple/package.json b/tests/simple/package.json index a856e07cf4..29598f734a 100644 --- a/tests/simple/package.json +++ b/tests/simple/package.json @@ -5,7 +5,9 @@ }, "testResultsProcessor": "../../coverageprocessor.js", "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "coverageReporters": ["json"], + "coverageReporters": [ + "json" + ], "collectCoverageFrom": [ "Hello.ts", "NullCoverage.js" diff --git a/tests/use-strict/__tests__/Strict-valid.test.ts b/tests/use-strict/__tests__/Strict-valid.test.ts index c2e48250a0..aa1dee7678 100644 --- a/tests/use-strict/__tests__/Strict-valid.test.ts +++ b/tests/use-strict/__tests__/Strict-valid.test.ts @@ -2,7 +2,7 @@ declare var jest, describe, it, expect; import { checkStrictValid } from '../Strict-valid'; -describe('Valid Strict', () => { +describe('Strict1', () => { it('should not throw an error', () => { From 98a3e38a7fa37a1be43cf8e952e5a8f468781467 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 24 Feb 2017 11:37:07 +0530 Subject: [PATCH 035/256] Remove unnecessary try/catch --- src/utils.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 71f271020b..aa11d46f0f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -57,14 +57,10 @@ function readRawConfig(argv, root) { } export function getJestConfig(root) { - try { - const yargs = require('yargs'); - const argv = yargs(process.argv.slice(2)).argv; - const rawConfig = readRawConfig(argv, root); - return Object.freeze(setFromArgv(rawConfig, argv)); - } catch (e) { - return {}; - } + const yargs = require('yargs'); + const argv = yargs(process.argv.slice(2)).argv; + const rawConfig = readRawConfig(argv, root); + return Object.freeze(setFromArgv(rawConfig, argv)); } export function getTSConfig(globals, collectCoverage: boolean = false) { From d92f57e5ff4d71c1cd3835e9c1bac0faa10e75da Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 1 Mar 2017 15:00:52 +0100 Subject: [PATCH 036/256] Examples comparing ts-jest and Jest setups The Jest example works with vscode The ts-jest example does not work with vscode --- examples/jest/.gitignore | 1 + examples/jest/Math.test.ts | 15 ++++++++++++ examples/jest/Math.ts | 11 +++++++++ examples/jest/app.ts | 7 ++++++ examples/jest/package.json | 28 +++++++++++++++++++++++ examples/jest/tsconfig.json | 24 +++++++++++++++++++ examples/ts-jest/.gitignore | 1 + examples/ts-jest/Math.test.ts | 15 ++++++++++++ examples/ts-jest/Math.ts | 11 +++++++++ examples/ts-jest/app.ts | 7 ++++++ examples/ts-jest/package.json | 42 ++++++++++++++++++++++++++++++++++ examples/ts-jest/tsconfig.json | 23 +++++++++++++++++++ 12 files changed, 185 insertions(+) create mode 100644 examples/jest/.gitignore create mode 100644 examples/jest/Math.test.ts create mode 100644 examples/jest/Math.ts create mode 100644 examples/jest/app.ts create mode 100644 examples/jest/package.json create mode 100644 examples/jest/tsconfig.json create mode 100644 examples/ts-jest/.gitignore create mode 100644 examples/ts-jest/Math.test.ts create mode 100644 examples/ts-jest/Math.ts create mode 100644 examples/ts-jest/app.ts create mode 100644 examples/ts-jest/package.json create mode 100644 examples/ts-jest/tsconfig.json diff --git a/examples/jest/.gitignore b/examples/jest/.gitignore new file mode 100644 index 0000000000..a6c7c2852d --- /dev/null +++ b/examples/jest/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/examples/jest/Math.test.ts b/examples/jest/Math.test.ts new file mode 100644 index 0000000000..70c54df7bf --- /dev/null +++ b/examples/jest/Math.test.ts @@ -0,0 +1,15 @@ +import Math from './Math'; + +const math = new Math(); + +test('add two numbers', () => { + const result = math.add(2, 4); + + expect(result).toEqual(6); +}); + +test('substract one number from another', () => { + const result = math.subtract(3, 6); + + expect(result).toEqual(-3); +}); diff --git a/examples/jest/Math.ts b/examples/jest/Math.ts new file mode 100644 index 0000000000..0ad7f3f6de --- /dev/null +++ b/examples/jest/Math.ts @@ -0,0 +1,11 @@ +class Math { + add(x: number, y: number) { + return x + y; + } + + subtract(x: number, y: number) { + return x - y; + } +} + +export default Math; diff --git a/examples/jest/app.ts b/examples/jest/app.ts new file mode 100644 index 0000000000..972027bbe4 --- /dev/null +++ b/examples/jest/app.ts @@ -0,0 +1,7 @@ +import Math from './Math'; + +const math = new Math(); +const result = math.add(2, 4); +console.log('Result:', result); + +process.exit(0); diff --git a/examples/jest/package.json b/examples/jest/package.json new file mode 100644 index 0000000000..9187253232 --- /dev/null +++ b/examples/jest/package.json @@ -0,0 +1,28 @@ +{ + "name": "jest-example", + "version": "1.0.0", + "license": "MIT", + + "scripts": { + "build": "tsc", + + "prestart": "npm run build", + "start": "node app.js", + + "pretest": "npm run build", + "test": "node --trace-warnings node_modules/.bin/jest --no-cache", + + "coverage": "node --trace-warnings node_modules/.bin/jest --no-cache --coverage", + + "clean": "rm *.js" + }, + + "devDependencies": { + "typescript": "latest", + + "@types/node": "latest", + + "jest": "latest", + "@types/jest": "latest" + } +} diff --git a/examples/jest/tsconfig.json b/examples/jest/tsconfig.json new file mode 100644 index 0000000000..b8e8eedc48 --- /dev/null +++ b/examples/jest/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es2015", + "jsx": "react", + "module": "commonjs", + "moduleResolution": "node", + "experimentalDecorators": true, + "sourceMap": false, + "inlineSourceMap": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "alwaysStrict": true + }, + + "files": [ + "app.ts", + "Math.ts", + "Math.test.ts" + ] +} diff --git a/examples/ts-jest/.gitignore b/examples/ts-jest/.gitignore new file mode 100644 index 0000000000..a6c7c2852d --- /dev/null +++ b/examples/ts-jest/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/examples/ts-jest/Math.test.ts b/examples/ts-jest/Math.test.ts new file mode 100644 index 0000000000..70c54df7bf --- /dev/null +++ b/examples/ts-jest/Math.test.ts @@ -0,0 +1,15 @@ +import Math from './Math'; + +const math = new Math(); + +test('add two numbers', () => { + const result = math.add(2, 4); + + expect(result).toEqual(6); +}); + +test('substract one number from another', () => { + const result = math.subtract(3, 6); + + expect(result).toEqual(-3); +}); diff --git a/examples/ts-jest/Math.ts b/examples/ts-jest/Math.ts new file mode 100644 index 0000000000..0ad7f3f6de --- /dev/null +++ b/examples/ts-jest/Math.ts @@ -0,0 +1,11 @@ +class Math { + add(x: number, y: number) { + return x + y; + } + + subtract(x: number, y: number) { + return x - y; + } +} + +export default Math; diff --git a/examples/ts-jest/app.ts b/examples/ts-jest/app.ts new file mode 100644 index 0000000000..972027bbe4 --- /dev/null +++ b/examples/ts-jest/app.ts @@ -0,0 +1,7 @@ +import Math from './Math'; + +const math = new Math(); +const result = math.add(2, 4); +console.log('Result:', result); + +process.exit(0); diff --git a/examples/ts-jest/package.json b/examples/ts-jest/package.json new file mode 100644 index 0000000000..3d2523bbe4 --- /dev/null +++ b/examples/ts-jest/package.json @@ -0,0 +1,42 @@ +{ + "name": "ts-jest-example", + "version": "1.0.0", + "license": "MIT", + + "scripts": { + "build": "tsc", + + "prestart": "npm run build", + "start": "node app.js", + + "test": "node --trace-warnings node_modules/.bin/jest --no-cache", + + "coverage": "node --trace-warnings node_modules/.bin/jest --no-cache --coverage", + + "clean": "rm *.js" + }, + + "jest": { + "transform": { + ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ], + "testResultsProcessor": "/node_modules/ts-jest/coverageprocessor.js" + }, + + "devDependencies": { + "typescript": "latest", + + "@types/node": "latest", + + "jest": "latest", + "@types/jest": "latest", + + "ts-jest": "latest" + } +} diff --git a/examples/ts-jest/tsconfig.json b/examples/ts-jest/tsconfig.json new file mode 100644 index 0000000000..662e44657b --- /dev/null +++ b/examples/ts-jest/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "es2015", + "jsx": "react", + "module": "commonjs", + "moduleResolution": "node", + "experimentalDecorators": true, + "sourceMap": false, + "inlineSourceMap": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "alwaysStrict": true + }, + + "files": [ + "app.ts", + "Math.ts" + ] +} From fc286f5119e02c318dbbb46d2aa8ba2fffdb2723 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 1 Mar 2017 21:34:07 +0530 Subject: [PATCH 037/256] Revert "Examples comparing ts-jest and Jest setups" --- examples/jest/.gitignore | 1 - examples/jest/Math.test.ts | 15 ------------ examples/jest/Math.ts | 11 --------- examples/jest/app.ts | 7 ------ examples/jest/package.json | 28 ----------------------- examples/jest/tsconfig.json | 24 ------------------- examples/ts-jest/.gitignore | 1 - examples/ts-jest/Math.test.ts | 15 ------------ examples/ts-jest/Math.ts | 11 --------- examples/ts-jest/app.ts | 7 ------ examples/ts-jest/package.json | 42 ---------------------------------- examples/ts-jest/tsconfig.json | 23 ------------------- 12 files changed, 185 deletions(-) delete mode 100644 examples/jest/.gitignore delete mode 100644 examples/jest/Math.test.ts delete mode 100644 examples/jest/Math.ts delete mode 100644 examples/jest/app.ts delete mode 100644 examples/jest/package.json delete mode 100644 examples/jest/tsconfig.json delete mode 100644 examples/ts-jest/.gitignore delete mode 100644 examples/ts-jest/Math.test.ts delete mode 100644 examples/ts-jest/Math.ts delete mode 100644 examples/ts-jest/app.ts delete mode 100644 examples/ts-jest/package.json delete mode 100644 examples/ts-jest/tsconfig.json diff --git a/examples/jest/.gitignore b/examples/jest/.gitignore deleted file mode 100644 index a6c7c2852d..0000000000 --- a/examples/jest/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.js diff --git a/examples/jest/Math.test.ts b/examples/jest/Math.test.ts deleted file mode 100644 index 70c54df7bf..0000000000 --- a/examples/jest/Math.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import Math from './Math'; - -const math = new Math(); - -test('add two numbers', () => { - const result = math.add(2, 4); - - expect(result).toEqual(6); -}); - -test('substract one number from another', () => { - const result = math.subtract(3, 6); - - expect(result).toEqual(-3); -}); diff --git a/examples/jest/Math.ts b/examples/jest/Math.ts deleted file mode 100644 index 0ad7f3f6de..0000000000 --- a/examples/jest/Math.ts +++ /dev/null @@ -1,11 +0,0 @@ -class Math { - add(x: number, y: number) { - return x + y; - } - - subtract(x: number, y: number) { - return x - y; - } -} - -export default Math; diff --git a/examples/jest/app.ts b/examples/jest/app.ts deleted file mode 100644 index 972027bbe4..0000000000 --- a/examples/jest/app.ts +++ /dev/null @@ -1,7 +0,0 @@ -import Math from './Math'; - -const math = new Math(); -const result = math.add(2, 4); -console.log('Result:', result); - -process.exit(0); diff --git a/examples/jest/package.json b/examples/jest/package.json deleted file mode 100644 index 9187253232..0000000000 --- a/examples/jest/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "jest-example", - "version": "1.0.0", - "license": "MIT", - - "scripts": { - "build": "tsc", - - "prestart": "npm run build", - "start": "node app.js", - - "pretest": "npm run build", - "test": "node --trace-warnings node_modules/.bin/jest --no-cache", - - "coverage": "node --trace-warnings node_modules/.bin/jest --no-cache --coverage", - - "clean": "rm *.js" - }, - - "devDependencies": { - "typescript": "latest", - - "@types/node": "latest", - - "jest": "latest", - "@types/jest": "latest" - } -} diff --git a/examples/jest/tsconfig.json b/examples/jest/tsconfig.json deleted file mode 100644 index b8e8eedc48..0000000000 --- a/examples/jest/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "jsx": "react", - "module": "commonjs", - "moduleResolution": "node", - "experimentalDecorators": true, - "sourceMap": false, - "inlineSourceMap": true, - "noUnusedLocals": true, - "noUnusedParameters": false, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitThis": true, - "forceConsistentCasingInFileNames": true, - "alwaysStrict": true - }, - - "files": [ - "app.ts", - "Math.ts", - "Math.test.ts" - ] -} diff --git a/examples/ts-jest/.gitignore b/examples/ts-jest/.gitignore deleted file mode 100644 index a6c7c2852d..0000000000 --- a/examples/ts-jest/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.js diff --git a/examples/ts-jest/Math.test.ts b/examples/ts-jest/Math.test.ts deleted file mode 100644 index 70c54df7bf..0000000000 --- a/examples/ts-jest/Math.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import Math from './Math'; - -const math = new Math(); - -test('add two numbers', () => { - const result = math.add(2, 4); - - expect(result).toEqual(6); -}); - -test('substract one number from another', () => { - const result = math.subtract(3, 6); - - expect(result).toEqual(-3); -}); diff --git a/examples/ts-jest/Math.ts b/examples/ts-jest/Math.ts deleted file mode 100644 index 0ad7f3f6de..0000000000 --- a/examples/ts-jest/Math.ts +++ /dev/null @@ -1,11 +0,0 @@ -class Math { - add(x: number, y: number) { - return x + y; - } - - subtract(x: number, y: number) { - return x - y; - } -} - -export default Math; diff --git a/examples/ts-jest/app.ts b/examples/ts-jest/app.ts deleted file mode 100644 index 972027bbe4..0000000000 --- a/examples/ts-jest/app.ts +++ /dev/null @@ -1,7 +0,0 @@ -import Math from './Math'; - -const math = new Math(); -const result = math.add(2, 4); -console.log('Result:', result); - -process.exit(0); diff --git a/examples/ts-jest/package.json b/examples/ts-jest/package.json deleted file mode 100644 index 3d2523bbe4..0000000000 --- a/examples/ts-jest/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "ts-jest-example", - "version": "1.0.0", - "license": "MIT", - - "scripts": { - "build": "tsc", - - "prestart": "npm run build", - "start": "node app.js", - - "test": "node --trace-warnings node_modules/.bin/jest --no-cache", - - "coverage": "node --trace-warnings node_modules/.bin/jest --no-cache --coverage", - - "clean": "rm *.js" - }, - - "jest": { - "transform": { - ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" - }, - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js" - ], - "testResultsProcessor": "/node_modules/ts-jest/coverageprocessor.js" - }, - - "devDependencies": { - "typescript": "latest", - - "@types/node": "latest", - - "jest": "latest", - "@types/jest": "latest", - - "ts-jest": "latest" - } -} diff --git a/examples/ts-jest/tsconfig.json b/examples/ts-jest/tsconfig.json deleted file mode 100644 index 662e44657b..0000000000 --- a/examples/ts-jest/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "jsx": "react", - "module": "commonjs", - "moduleResolution": "node", - "experimentalDecorators": true, - "sourceMap": false, - "inlineSourceMap": true, - "noUnusedLocals": true, - "noUnusedParameters": false, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitThis": true, - "forceConsistentCasingInFileNames": true, - "alwaysStrict": true - }, - - "files": [ - "app.ts", - "Math.ts" - ] -} From 192b493af8843a2387476d8de9a474067afc229e Mon Sep 17 00:00:00 2001 From: Alex J Date: Fri, 10 Mar 2017 20:43:16 +0100 Subject: [PATCH 038/256] Hardcode commonjs module --- AUTHORS | 1 + src/utils.ts | 5 ++++- tests/__tests__/tsconfig-default.spec.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 08e6f5e2bb..f26cf179c0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,6 +3,7 @@ # # Name/Organization +Alex Jover Morales Bartosz Gościński Blake Embrey Emil Persson diff --git a/src/utils.ts b/src/utils.ts index aa11d46f0f..fe327a9ac2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -78,7 +78,10 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config = Object.assign({}, require(parentConfigPath).compilerOptions, config); } } - config.module = config.module || tsc.ModuleKind.CommonJS; + + + + config.module = 'commonjs'; config.jsx = config.jsx || tsc.JsxEmit.React; //inline source with source map for remapping coverage diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index ec71226e2e..573ab68b1b 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -63,4 +63,16 @@ describe('get default ts config', () => { expect(result).toEqual(resultNullContent); }); + it('should set the module to CommonJS if it is not', () => { + const {getTSConfig} = require('../../src/utils'); + const config = getTSConfig({ + '__TS_CONFIG__': { + 'module': 'es2015' + } + }); + console.log(config) + + expect(config.module).toBe(ts.ModuleKind.CommonJS); + }); + }); From 892bf9c50020039f019b4622a54226b3c35907c4 Mon Sep 17 00:00:00 2001 From: Alex J Date: Fri, 10 Mar 2017 20:46:41 +0100 Subject: [PATCH 039/256] Add note in docs --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9a01f808a1..d2d1bbc6ab 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ ## Versioning -From version `"jest": "17.0.0"` we are using same MAJOR.MINOR as [`Jest`](https://github.com/facebook/jest). +From version `"jest": "17.0.0"` we are using same MAJOR.MINOR as [`Jest`](https://github.com/facebook/jest). For `"jest": "< 17.0.0"` use `"ts-jest": "0.1.13"`. Docs for it see [here](https://github.com/kulshekhar/ts-jest/blob/e1f95e524ed62091736f70abf63530f1f107ec03/README.md). ## Usage @@ -91,7 +91,10 @@ In `package.json`, inside `jest` section, the `transform` should be like this: ``` ## Options -By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. +By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. + +Additionaly, `module` property will be overwritten to `commonjs` since is what Jest expects. + But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: ```json { @@ -117,7 +120,7 @@ Or even declare options for `tsc` instead of using separate config, like this: ``` For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). -### Known limitations for TS compiler options +### Known limitations for TS compiler options - You can't use `"target": "ES6"` while using `node v4` in your test environment; - You can't use `"react": "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: @@ -125,7 +128,7 @@ For all available options see [TypeScript docs](https://www.typescriptlang.org/d "jest": { "moduleDirectories": ["node_modules", ""] } -``` +``` ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. @@ -141,5 +144,5 @@ npm test ## License -Copyright (c) [Authors](AUTHORS). +Copyright (c) [Authors](AUTHORS). This source code is licensed under the [MIT license](LICENSE). From 8a4347e3e886c34679280362829ffa4230afd496 Mon Sep 17 00:00:00 2001 From: Alex J Date: Fri, 10 Mar 2017 21:07:01 +0100 Subject: [PATCH 040/256] Fix minor issues with format and docs --- README.md | 2 +- src/utils.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index d2d1bbc6ab..7ef9413e65 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ In `package.json`, inside `jest` section, the `transform` should be like this: ## Options By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. -Additionaly, `module` property will be overwritten to `commonjs` since is what Jest expects. +Additionaly, `module` property will be overwritten to `commonjs` since that is the format Jest expects But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: ```json diff --git a/src/utils.ts b/src/utils.ts index fe327a9ac2..f371fa3928 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -79,8 +79,6 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { } } - - config.module = 'commonjs'; config.jsx = config.jsx || tsc.JsxEmit.React; From c3cae1b8798a08bf122620bc70ccc8ed32903d28 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 11 Mar 2017 01:48:19 +0530 Subject: [PATCH 041/256] Reorder a sentence to prevent confusion --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ef9413e65..411bfeacdd 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,6 @@ In `package.json`, inside `jest` section, the `transform` should be like this: ## Options By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. -Additionaly, `module` property will be overwritten to `commonjs` since that is the format Jest expects - But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: ```json { @@ -118,6 +116,8 @@ Or even declare options for `tsc` instead of using separate config, like this: } } ``` +Note that, `module` property will be overwritten to `commonjs` since that is the format Jest expects. + For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). ### Known limitations for TS compiler options From 06bee0d301401401be8d6f689a024607b7d5c4d1 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 11 Mar 2017 01:49:15 +0530 Subject: [PATCH 042/256] Fix grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 411bfeacdd..dc8d668a14 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ Or even declare options for `tsc` instead of using separate config, like this: } } ``` -Note that, `module` property will be overwritten to `commonjs` since that is the format Jest expects. +Note that the `module` property will be overwritten to `commonjs` since that is the format Jest expects. For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). From 51973ae7e3a5abbb16dfa5e80bc1f31871b38331 Mon Sep 17 00:00:00 2001 From: Chong Guo Date: Sun, 12 Mar 2017 21:06:44 -0700 Subject: [PATCH 043/256] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc8d668a14..e2dcc2f737 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ For all available options see [TypeScript docs](https://www.typescriptlang.org/d ### Known limitations for TS compiler options - You can't use `"target": "ES6"` while using `node v4` in your test environment; -- You can't use `"react": "preserve"` for now (see [progress of this issue](https://github.com/kulshekhar/ts-jest/issues/63)); +- 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: ```json "jest": { From 21dcc728c4a0eb27fcffb35855c25f12163d8e6e Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Mon, 13 Mar 2017 12:33:55 +0530 Subject: [PATCH 044/256] Update AUTHORS add @Armour to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f26cf179c0..3b9462a0f9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,6 +6,7 @@ Alex Jover Morales Bartosz Gościński Blake Embrey +Chong Guo Emil Persson Eric Anderson Felipe Matos From 6f835afea9ed1753659c2e1deff8b21e90c8bae9 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 14 Mar 2017 21:58:02 +1100 Subject: [PATCH 045/256] feat: export transpileIfTypescript --- src/index.ts | 1 + src/transpile-if-ts.ts | 4 ++-- tests/__tests__/transpileIfTypescript.spec.ts | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/__tests__/transpileIfTypescript.spec.ts diff --git a/src/index.ts b/src/index.ts index 1f8bc46ab0..338a527f4c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import { defaultRetrieveFileHandler } from './default-retrieve-file-handler'; import * as sourceMapSupport from 'source-map-support'; +export { transpileIfTypescript } from './transpile-if-ts'; export function install() { var options: sourceMapSupport.Options = {}; options.retrieveFile = defaultRetrieveFileHandler; diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index 2c9c596ef0..f7cbd2afc7 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -1,11 +1,11 @@ import * as tsc from 'typescript'; import { getTSConfig } from './utils'; -export function transpileIfTypescript(path, contents) { +export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { let transpiled = tsc.transpileModule(contents, { - compilerOptions: getTSConfig({ __TS_CONFIG__: global['__TS_CONFIG__'] }, true), + compilerOptions: getTSConfig(config || { __TS_CONFIG__: global['__TS_CONFIG__'] }, true), fileName: path }); diff --git a/tests/__tests__/transpileIfTypescript.spec.ts b/tests/__tests__/transpileIfTypescript.spec.ts new file mode 100644 index 0000000000..5a6d04b0fb --- /dev/null +++ b/tests/__tests__/transpileIfTypescript.spec.ts @@ -0,0 +1,19 @@ +import { transpileIfTypescript } from '../../src'; + +describe.only('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_CONFIG__: customTsConfigFile}; + expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile)); + }); +}); \ No newline at end of file From f6d8ea7c96173be1995ae6bc64df781ef057827a Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 14 Mar 2017 22:42:31 +1100 Subject: [PATCH 046/256] Add line break and rename to kebab case --- .../{transpileIfTypescript.spec.ts => transpile-if-ts.spec.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/__tests__/{transpileIfTypescript.spec.ts => transpile-if-ts.spec.ts} (99%) diff --git a/tests/__tests__/transpileIfTypescript.spec.ts b/tests/__tests__/transpile-if-ts.spec.ts similarity index 99% rename from tests/__tests__/transpileIfTypescript.spec.ts rename to tests/__tests__/transpile-if-ts.spec.ts index 5a6d04b0fb..7241cffdb0 100644 --- a/tests/__tests__/transpileIfTypescript.spec.ts +++ b/tests/__tests__/transpile-if-ts.spec.ts @@ -16,4 +16,4 @@ describe.only('transpileIfTypescript', () => { const customConfig = { __TS_CONFIG__: customTsConfigFile}; expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile)); }); -}); \ No newline at end of file +}); From 9a2f6c5e00ffed2bac93e94f4e869ebc9e10c773 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 14 Mar 2017 22:43:19 +1100 Subject: [PATCH 047/256] remove: only --- tests/__tests__/transpile-if-ts.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__tests__/transpile-if-ts.spec.ts b/tests/__tests__/transpile-if-ts.spec.ts index 7241cffdb0..3d9337c56e 100644 --- a/tests/__tests__/transpile-if-ts.spec.ts +++ b/tests/__tests__/transpile-if-ts.spec.ts @@ -1,6 +1,6 @@ import { transpileIfTypescript } from '../../src'; -describe.only('transpileIfTypescript', () => { +describe('transpileIfTypescript', () => { it('should ignore anything non-TS', () => { const contents = 'unaltered'; expect(transpileIfTypescript('some.js', contents)).toBe(contents); From 157ea1965904e4f36c7d9b075658b91a4c2b317e Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 14 Mar 2017 17:34:12 +0530 Subject: [PATCH 048/256] Bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b25df89592..92fe213f49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.0", + "version": "19.0.1", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", @@ -92,4 +92,4 @@ "tslint": "next", "typescript": "latest" } -} \ No newline at end of file +} From a582df7f1988ff4fcca5e60dd4d26c5682c68f8d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 15 Mar 2017 00:22:02 +0530 Subject: [PATCH 049/256] Update AUTHORS Add @joscha to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 3b9462a0f9..47cb1038ce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Emil Persson Eric Anderson Felipe Matos Ihor Chulinda +Joscha Feth Kulshekhar Kabra Maxim Samoilov OJ Kwon From 86b215b1d7c535002aff4d751d1b63e4ef33aba1 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 16 Mar 2017 00:12:34 +0530 Subject: [PATCH 050/256] Create ISSUE_TEMPLATE --- .github/ISSUE_TEMPLATE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 0000000000..50b5c8eade --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1,21 @@ +- Issue + +[describe the issue here] + + + +- Expected behavior + +[describe the expected behavior here] + + + +- 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. From d2ff7c5e04bf12e3f916fe9c382bdcbdc2d1872e Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 15:22:55 -0400 Subject: [PATCH 051/256] Fix coverage for 19.x --- package.json | 2 ++ src/coverageprocessor.ts | 72 +++++++++++++++++++++++++++++----------- src/preprocessor.ts | 44 ++++-------------------- 3 files changed, 62 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 92fe213f49..fc771dd482 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ ] }, "dependencies": { + "fs-extra": "^2.1.2", "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", "jest-config": "^19.0.0", @@ -73,6 +74,7 @@ }, "devDependencies": { "@types/es6-shim": "latest", + "@types/fs-extra": "^2.0.0", "@types/jest": "latest", "@types/lodash.assign": "latest", "@types/lodash.includes": "latest", diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 1bb9bd4e2a..3999b8938d 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -1,13 +1,5 @@ -declare const global: { - __ts_coverage__cache__: { - coverageConfig: any; - sourceCache: any[]; - coverageCollectFiles: any[]; - } -} - import * as path from 'path'; - +import * as fs from 'fs'; import includes = require('lodash.includes'); import partition = require('lodash.partition'); const loadCoverage = require('remap-istanbul/lib/loadCoverage'); @@ -15,6 +7,8 @@ const remap = require('remap-istanbul/lib/remap'); const writeReport = require('remap-istanbul/lib/writeReport'); const istanbulInstrument = require('istanbul-lib-instrument'); import pickBy = require('lodash.pickby') +import {getJestConfig} from './utils'; +const glob = require('glob-all'); interface CoverageMap { merge: (data: Object) => void; @@ -23,28 +17,56 @@ interface CoverageMap { addFileCoverage: (fileCoverage: Object) => void; } +declare const global: { + __ts_coverage__cache__: { + coverageConfig: any; + sourceCache: any[]; + coverageCollectFiles: any[]; + } +}; + // full type https://github.com/facebook/jest/blob/master/types/TestResult.js interface Result { coverageMap: CoverageMap; } function processResult(result: Result): Result { - if (!global.__ts_coverage__cache__) return result; - const { coverageConfig, sourceCache, coverageCollectFiles } = global.__ts_coverage__cache__; + const root = require('jest-util').getPackageRoot(); + const jestConfig = getJestConfig(root).config; + let sourceCache = {}; + let coveredFiles = []; + walkDir(path.join(jestConfig.cacheDirectory, '/ts-jest/')).map((p) => { + let filename = p.replace(path.join(jestConfig.cacheDirectory, '/ts-jest/'), ''); + coveredFiles.push(filename); + sourceCache[filename] = fs.readFileSync(p, 'utf8'); + }); + + if (!jestConfig.testResultsProcessor) return result; + const coverageConfig = { + collectCoverage: jestConfig.collectCoverage, + coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : './coverage/', + coverageReporters: jestConfig.coverageReporters + }; + const coverageCollectFiles = + jestConfig.collectCoverage && + jestConfig.testResultsProcessor && + jestConfig.collectCoverageFrom && + jestConfig.collectCoverageFrom.length ? + glob.sync(jestConfig.collectCoverageFrom).map(x => path.resolve(root, x)) : []; if (!coverageConfig.collectCoverage) return result; + console.log(coverageConfig); - const coveredFiles = Object.keys(sourceCache) - const coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))] + const coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))]; const uncoveredFiles = partition(coverageCollectFiles, x => includes(coveredFiles, x))[1]; const coverageOutputPath = path.join(coverageConfig.coverageDirectory || 'coverage', 'remapped'); - //generate 'empty' coverage against uncovered files. - //If source is non-ts passed by allowJS, return empty since not able to lookup from cache - const emptyCoverage = uncoveredFiles.map(x => { - var ret = {}; + // //generate 'empty' coverage against uncovered files. + // //If source is non-ts passed by allowJS, return empty since not able to lookup from cache + const emptyCoverage = uncoveredFiles.map((x:string) => { + let ret = {}; if (sourceCache[x]) { - var instrumenter = istanbulInstrument.createInstrumenter(); + let instrumenter = istanbulInstrument.createInstrumenter(); instrumenter.instrumentSync(sourceCache[x], x); ret[x] = instrumenter.fileCoverage; } @@ -56,7 +78,7 @@ function processResult(result: Result): Result { readFile: (x) => { const key = path.normalize(x); const source = sourceCache[key]; - delete global.__ts_coverage__cache__.sourceCache[key]; + delete sourceCache[key]; return source; } }); @@ -68,4 +90,16 @@ function processResult(result: Result): Result { return result; } +function walkDir(root) { + const stat = fs.statSync(root); + + if (stat.isDirectory()) { + const dirs = fs.readdirSync(root).filter(item => !item.startsWith('.')); + let results = dirs.map(sub => walkDir(`${root}/${sub}`)); + return [].concat(...results); + } else { + return root; + } +} + module.exports = processResult; \ No newline at end of file diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 7e1025a436..45df2907da 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,59 +1,29 @@ +import * as fs from 'fs-extra'; import * as tsc from 'typescript'; -import * as nodepath from 'path'; -import { getTSConfig, getJestConfig } from './utils'; +import {getTSConfig} from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); -const getPackageRoot = require('jest-util').getPackageRoot; - -declare const global: any; - -const root = getPackageRoot(); -const jestConfig = getJestConfig(root); -const { collectCoverage } = jestConfig; -const { - testRegex, - coverageDirectory, - coverageReporters, - collectCoverageFrom, - testResultsProcessor -} = jestConfig.config; - -//setting up cache to global object to resultprocessor consume -if (testResultsProcessor) { - global.__ts_coverage__cache__ = {}; - global.__ts_coverage__cache__.sourceCache = {}; - global.__ts_coverage__cache__.coverageConfig = { collectCoverage, coverageDirectory, coverageReporters }; - global.__ts_coverage__cache__.coverageCollectFiles = - collectCoverage && - testResultsProcessor && - collectCoverageFrom && - collectCoverageFrom.length ? - glob.sync(collectCoverageFrom).map(x => nodepath.resolve(root, x)) : []; -} +const nodepath = require('path'); export function process(src, path, config) { if (path.endsWith('.ts') || path.endsWith('.tsx')) { const transpiled = tsc.transpileModule( src, { - compilerOptions: getTSConfig(config.globals, collectCoverage), + compilerOptions: getTSConfig(config.globals, config.collectCoverage), fileName: path }); //store transpiled code contains source map into cache, except test cases - if (global.__ts_coverage__cache__) { - if (!testRegex || !path.match(testRegex)) { - global.__ts_coverage__cache__.sourceCache[path] = transpiled.outputText; - } + if (!config.testRegex || !path.match(config.testRegex)) { + fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', path), transpiled.outputText); } const start = transpiled.outputText.length > 12 ? transpiled.outputText.substr(1, 10) : ''; - const modified = start === 'use strict' + return start === 'use strict' ? `'use strict';require('ts-jest').install();${transpiled.outputText}` : `require('ts-jest').install();${transpiled.outputText}`; - - return modified; } return src; From 4a611f470690e8330b8a6be961d404d8c6d90622 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 16:04:10 -0400 Subject: [PATCH 052/256] Fix tests --- src/coverageprocessor.ts | 16 ++++++++++++---- tests/__tests__/ts-coverage.spec.ts | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 3999b8938d..d5a911c517 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -35,6 +35,7 @@ function processResult(result: Result): Result { const jestConfig = getJestConfig(root).config; let sourceCache = {}; let coveredFiles = []; + walkDir(path.join(jestConfig.cacheDirectory, '/ts-jest/')).map((p) => { let filename = p.replace(path.join(jestConfig.cacheDirectory, '/ts-jest/'), ''); coveredFiles.push(filename); @@ -42,21 +43,28 @@ function processResult(result: Result): Result { }); if (!jestConfig.testResultsProcessor) return result; + const coverageConfig = { - collectCoverage: jestConfig.collectCoverage, + collectCoverage: jestConfig.collectCoverage ? jestConfig.collectCoverage : true, coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : './coverage/', coverageReporters: jestConfig.coverageReporters }; + const coverageCollectFiles = - jestConfig.collectCoverage && + coverageConfig.collectCoverage && jestConfig.testResultsProcessor && jestConfig.collectCoverageFrom && jestConfig.collectCoverageFrom.length ? glob.sync(jestConfig.collectCoverageFrom).map(x => path.resolve(root, x)) : []; + if (!coverageConfig.collectCoverage) return result; - console.log(coverageConfig); - const coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))]; + let coverage; + try { + coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))]; + } catch(e) { + return result; + } const uncoveredFiles = partition(coverageCollectFiles, x => includes(coveredFiles, x))[1]; const coverageOutputPath = path.join(coverageConfig.coverageDirectory || 'coverage', 'remapped'); diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 8143bc8f4a..cc53854a3c 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -7,7 +7,7 @@ describe('hello_world', () => { `-----------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -----------|----------|----------|----------|----------|----------------| - simple${path.sep} | 90.91 | 50 | 80 | 88.89 | | + simple/ | 90.91 | 50 | 80 | 88.89 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | -----------|----------|----------|----------|----------|----------------| All files | 90.91 | 50 | 80 | 88.89 | | From 12d920daabeb337473d9cae007fe389a0b12eec6 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 16:45:12 -0400 Subject: [PATCH 053/256] Fix windows --- src/coverageprocessor.ts | 2 +- src/preprocessor.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index d5a911c517..6a1f232c4b 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -37,7 +37,7 @@ function processResult(result: Result): Result { let coveredFiles = []; walkDir(path.join(jestConfig.cacheDirectory, '/ts-jest/')).map((p) => { - let filename = p.replace(path.join(jestConfig.cacheDirectory, '/ts-jest/'), ''); + let filename = root + p.replace(path.join(jestConfig.cacheDirectory, '/ts-jest/'), ''); coveredFiles.push(filename); sourceCache[filename] = fs.readFileSync(p, 'utf8'); }); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 45df2907da..74164a6473 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -6,6 +6,7 @@ const glob = require('glob-all'); const nodepath = require('path'); export function process(src, path, config) { + const root = require('jest-util').getPackageRoot(); if (path.endsWith('.ts') || path.endsWith('.tsx')) { const transpiled = tsc.transpileModule( src, @@ -16,7 +17,7 @@ export function process(src, path, config) { //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { - fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', path), transpiled.outputText); + fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', path.replace(root, '')), transpiled.outputText); } const start = transpiled.outputText.length > 12 ? transpiled.outputText.substr(1, 10) : ''; From e7e5468511cca57b210e7190e462330d9317f897 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 17:17:31 -0400 Subject: [PATCH 054/256] Move to base64 for windows filename nonsense --- src/coverageprocessor.ts | 20 +++++--------------- src/preprocessor.ts | 3 +-- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 6a1f232c4b..5851f75c73 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -36,10 +36,12 @@ function processResult(result: Result): Result { let sourceCache = {}; let coveredFiles = []; - walkDir(path.join(jestConfig.cacheDirectory, '/ts-jest/')).map((p) => { - let filename = root + p.replace(path.join(jestConfig.cacheDirectory, '/ts-jest/'), ''); + let basepath = path.join(jestConfig.cacheDirectory, '/ts-jest/'); + let cachedFiles = fs.readdirSync(basepath); + cachedFiles.map((p) => { + let filename = new Buffer(p.replace(basepath, ''), 'base64').toString('utf8'); coveredFiles.push(filename); - sourceCache[filename] = fs.readFileSync(p, 'utf8'); + sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); }); if (!jestConfig.testResultsProcessor) return result; @@ -98,16 +100,4 @@ function processResult(result: Result): Result { return result; } -function walkDir(root) { - const stat = fs.statSync(root); - - if (stat.isDirectory()) { - const dirs = fs.readdirSync(root).filter(item => !item.startsWith('.')); - let results = dirs.map(sub => walkDir(`${root}/${sub}`)); - return [].concat(...results); - } else { - return root; - } -} - module.exports = processResult; \ No newline at end of file diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 74164a6473..9712177a33 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -6,7 +6,6 @@ const glob = require('glob-all'); const nodepath = require('path'); export function process(src, path, config) { - const root = require('jest-util').getPackageRoot(); if (path.endsWith('.ts') || path.endsWith('.tsx')) { const transpiled = tsc.transpileModule( src, @@ -17,7 +16,7 @@ export function process(src, path, config) { //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { - fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', path.replace(root, '')), transpiled.outputText); + fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', new Buffer(path).toString('base64')), transpiled.outputText); } const start = transpiled.outputText.length > 12 ? transpiled.outputText.substr(1, 10) : ''; From c5db61885a8961f789b3ef8929d269ac85c2e9eb Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 17:32:52 -0400 Subject: [PATCH 055/256] disable format test --- tests/__tests__/ts-coverage.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index cc53854a3c..480702491a 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -20,7 +20,8 @@ All files | 90.91 | 50 | 80 | 88.89 | | const coveragePath = path.resolve('./tests/simple/coverage/remapped/coverage.txt'); expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); + // TODO: Turning this off -- appveyor formats differently and blows up + // expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); }); }); \ No newline at end of file From 5b343a075dfb6f5511da410bd68bacd82b84a748 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Fri, 17 Mar 2017 17:42:03 -0400 Subject: [PATCH 056/256] Bring back path.sep --- tests/__tests__/ts-coverage.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 480702491a..8143bc8f4a 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -7,7 +7,7 @@ describe('hello_world', () => { `-----------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -----------|----------|----------|----------|----------|----------------| - simple/ | 90.91 | 50 | 80 | 88.89 | | + simple${path.sep} | 90.91 | 50 | 80 | 88.89 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | -----------|----------|----------|----------|----------|----------------| All files | 90.91 | 50 | 80 | 88.89 | | @@ -20,8 +20,7 @@ All files | 90.91 | 50 | 80 | 88.89 | | const coveragePath = path.resolve('./tests/simple/coverage/remapped/coverage.txt'); expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - // TODO: Turning this off -- appveyor formats differently and blows up - // expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); + expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); }); }); \ No newline at end of file From 5d159f57c72ee183ac32b890e3a3df669caaadfb Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Sat, 18 Mar 2017 10:12:16 -0400 Subject: [PATCH 057/256] per @kulshekhar --- src/preprocessor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 9712177a33..b9efe5ad44 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -21,9 +21,11 @@ export function process(src, path, config) { const start = transpiled.outputText.length > 12 ? transpiled.outputText.substr(1, 10) : ''; - return start === 'use strict' + const modified = start === 'use strict' ? `'use strict';require('ts-jest').install();${transpiled.outputText}` : `require('ts-jest').install();${transpiled.outputText}`; + + return modified; } return src; From f5210a407ba9bc7acda96bf5467da11c0a9b7f54 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Sat, 18 Mar 2017 10:22:18 -0400 Subject: [PATCH 058/256] Added extra test --- tests/__tests__/ts-remapped-coverage.spec.ts | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/__tests__/ts-remapped-coverage.spec.ts diff --git a/tests/__tests__/ts-remapped-coverage.spec.ts b/tests/__tests__/ts-remapped-coverage.spec.ts new file mode 100644 index 0000000000..e8ad7e2050 --- /dev/null +++ b/tests/__tests__/ts-remapped-coverage.spec.ts @@ -0,0 +1,27 @@ +import runJest from '../__helpers__/runJest'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('tsremappedcoverage', () => { + const snapshot = + `---------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +---------------------|----------|----------|----------|----------|----------------| + tsremappedcoverage${path.sep} | 100 | 100 | 100 | 100 | | + a.ts | 100 | 100 | 100 | 100 | | + b.ts | 100 | 100 | 100 | 100 | | +---------------------|----------|----------|----------|----------|----------------| +All files | 100 | 100 | 100 | 100 | | +---------------------|----------|----------|----------|----------|----------------| +`; + + it('should run successfully', () => { + runJest('../tsremappedcoverage', ['--no-cache', '--coverage']); + + const coveragePath = path.resolve('./tests/tsremappedcoverage/coverage/remapped/coverage.txt'); + + expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); + expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); + }); + +}); \ No newline at end of file From b34d42d3b0ffa07d6ea171e6a532f74c1100eb67 Mon Sep 17 00:00:00 2001 From: Henry Zektser Date: Sat, 18 Mar 2017 10:26:41 -0400 Subject: [PATCH 059/256] Missed files --- tests/tsremappedcoverage/a.test.ts | 5 ++++ tests/tsremappedcoverage/a.ts | 1 + tests/tsremappedcoverage/b.test.ts | 5 ++++ tests/tsremappedcoverage/b.ts | 1 + tests/tsremappedcoverage/package.json | 33 ++++++++++++++++++++++++++ tests/tsremappedcoverage/tsconfig.json | 3 +++ 6 files changed, 48 insertions(+) create mode 100644 tests/tsremappedcoverage/a.test.ts create mode 100644 tests/tsremappedcoverage/a.ts create mode 100644 tests/tsremappedcoverage/b.test.ts create mode 100644 tests/tsremappedcoverage/b.ts create mode 100644 tests/tsremappedcoverage/package.json create mode 100644 tests/tsremappedcoverage/tsconfig.json diff --git a/tests/tsremappedcoverage/a.test.ts b/tests/tsremappedcoverage/a.test.ts new file mode 100644 index 0000000000..b4e839d5fd --- /dev/null +++ b/tests/tsremappedcoverage/a.test.ts @@ -0,0 +1,5 @@ +import { a } from './a' + +it('a', () => { + expect(a).toBe(0) +}) diff --git a/tests/tsremappedcoverage/a.ts b/tests/tsremappedcoverage/a.ts new file mode 100644 index 0000000000..c4b41a2c0b --- /dev/null +++ b/tests/tsremappedcoverage/a.ts @@ -0,0 +1 @@ +export const a = 0 diff --git a/tests/tsremappedcoverage/b.test.ts b/tests/tsremappedcoverage/b.test.ts new file mode 100644 index 0000000000..97f02513f4 --- /dev/null +++ b/tests/tsremappedcoverage/b.test.ts @@ -0,0 +1,5 @@ +import { b } from './b' + +it('b', () => { + expect(b).toBe(0) +}) diff --git a/tests/tsremappedcoverage/b.ts b/tests/tsremappedcoverage/b.ts new file mode 100644 index 0000000000..f108918c6f --- /dev/null +++ b/tests/tsremappedcoverage/b.ts @@ -0,0 +1 @@ +export const b = 0 diff --git a/tests/tsremappedcoverage/package.json b/tests/tsremappedcoverage/package.json new file mode 100644 index 0000000000..807a47349b --- /dev/null +++ b/tests/tsremappedcoverage/package.json @@ -0,0 +1,33 @@ +{ + "scripts": { + "test": "shx rm -rf coverage && jest --coverage --no-cache", + "test:series": "shx rm -rf coverage && jest -i --coverage --no-cache" + }, + "jest": { + "collectCoverageFrom": [ + "**/*.ts" + ], + "moduleFileExtensions": [ + "js", + "ts" + ], + "testRegex": "\\.test\\.ts$", + "testResultsProcessor": "../../coverageprocessor.js", + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + } + }, + "dependencies": { + "@types/jest": "19.2.0", + "jest": "19.0.2", + "jest-cli": "19.0.2", + "shx": "0.2.2", + "ts-jest": "19.0.0", + "typescript": "2.2.1" + }, + "engines": { + "node": "7.7.2", + "npm": "4.3.0" + }, + "private": true +} diff --git a/tests/tsremappedcoverage/tsconfig.json b/tests/tsremappedcoverage/tsconfig.json new file mode 100644 index 0000000000..78a6452265 --- /dev/null +++ b/tests/tsremappedcoverage/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compileOnSave": false +} From e944dfcaecd53d0d077ae4a00974dfd46be6e051 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sun, 19 Mar 2017 00:10:23 +0530 Subject: [PATCH 060/256] Update AUTHORS Add @japhar81 to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 47cb1038ce..3b603cee94 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,6 +10,7 @@ Chong Guo Emil Persson Eric Anderson Felipe Matos +Henry Zektser Ihor Chulinda Joscha Feth Kulshekhar Kabra From 3010a96a9e4f513dff783a834a95986212722cf2 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sun, 19 Mar 2017 01:11:25 +0530 Subject: [PATCH 061/256] Process JS files if `allowJs` flag is `true` resolves 133 --- src/preprocessor.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index b9efe5ad44..50a5f86a01 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -6,11 +6,20 @@ const glob = require('glob-all'); const nodepath = require('path'); export function process(src, path, config) { - if (path.endsWith('.ts') || path.endsWith('.tsx')) { + const compilerOptions = getTSConfig(config.globals, config.collectCoverage); + + const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); + const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); + + const processFile = compilerOptions.allowJs === true + ? isTsFile || isJsFile + : isTsFile; + + if (processFile) { const transpiled = tsc.transpileModule( src, { - compilerOptions: getTSConfig(config.globals, config.collectCoverage), + compilerOptions: compilerOptions, fileName: path }); @@ -29,4 +38,4 @@ export function process(src, path, config) { } return src; -} \ No newline at end of file +} From b5586ca73209120a79e52f8f31e8d5c65c43296c Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 19 Mar 2017 01:25:30 +0530 Subject: [PATCH 062/256] Remove console.log --- tests/__tests__/tsconfig-default.spec.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index 573ab68b1b..85f4bb822d 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -12,10 +12,10 @@ describe('get default ts config', () => { }); it('should correctly read tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig(); - expect(result).toEqual ({ + expect(result).toEqual({ 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -25,10 +25,10 @@ describe('get default ts config', () => { }); it('should not read my-tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig(); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -38,17 +38,17 @@ describe('get default ts config', () => { }); it('should not read inline tsconfig options', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig(); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'module': ts.ModuleKind.CommonJS, 'jsx': ts.JsxEmit.React }); }); it('should be same results for null/undefined/etc.', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig(); const resultUndefinedParam = getTSConfig(undefined); const resultNullParam = getTSConfig(null); @@ -64,13 +64,12 @@ describe('get default ts config', () => { }); it('should set the module to CommonJS if it is not', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const config = getTSConfig({ '__TS_CONFIG__': { 'module': 'es2015' } }); - console.log(config) expect(config.module).toBe(ts.ModuleKind.CommonJS); }); From df440126f3ba455466ce8f1481150dcc9601da5b Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 19 Mar 2017 01:35:02 +0530 Subject: [PATCH 063/256] Include JS file in coverage for `simple` test --- tests/__tests__/ts-coverage.spec.ts | 19 ++++++++++--------- tests/simple/tsconfig.json | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 8143bc8f4a..89b1d11810 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -4,14 +4,15 @@ import * as path from 'path'; describe('hello_world', () => { const snapshot = - `-----------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------|----------|----------|----------|----------|----------------| - simple${path.sep} | 90.91 | 50 | 80 | 88.89 | | - Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | ------------|----------|----------|----------|----------|----------------| -All files | 90.91 | 50 | 80 | 88.89 | | ------------|----------|----------|----------|----------|----------------| + `------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +------------------|----------|----------|----------|----------|----------------| + simple/ | 71.43 | 33.33 | 66.67 | 66.67 | | + Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | + NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | +------------------|----------|----------|----------|----------|----------------| +All files | 71.43 | 33.33 | 66.67 | 66.67 | | +------------------|----------|----------|----------|----------|----------------| `; it('should run successfully', () => { @@ -23,4 +24,4 @@ All files | 90.91 | 50 | 80 | 88.89 | | expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); }); -}); \ No newline at end of file +}); diff --git a/tests/simple/tsconfig.json b/tests/simple/tsconfig.json index 5e2c68f9ff..55f8667f97 100644 --- a/tests/simple/tsconfig.json +++ b/tests/simple/tsconfig.json @@ -7,4 +7,4 @@ "jsx": "react", "allowJs": true } -} \ No newline at end of file +} From 5fef998275aa6330b812a1e741bee0111981f2a5 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 19 Mar 2017 01:37:39 +0530 Subject: [PATCH 064/256] Include JS file in coverage for `simple-async` test --- tests/__tests__/ts-coverage-async.spec.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index b396c73efa..a3e1ac7f11 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -4,14 +4,15 @@ import * as path from 'path'; describe('hello_world', () => { const snapshot = -`---------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ----------------|----------|----------|----------|----------|----------------| - simple-async${path.sep} | 90.91 | 50 | 80 | 88.89 | | - Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | ----------------|----------|----------|----------|----------|----------------| -All files | 90.91 | 50 | 80 | 88.89 | | ----------------|----------|----------|----------|----------|----------------| + `------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +------------------|----------|----------|----------|----------|----------------| + simple-async/ | 71.43 | 33.33 | 66.67 | 66.67 | | + Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | + NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | +------------------|----------|----------|----------|----------|----------------| +All files | 71.43 | 33.33 | 66.67 | 66.67 | | +------------------|----------|----------|----------|----------|----------------| `; it('should run successfully', () => { @@ -23,4 +24,4 @@ All files | 90.91 | 50 | 80 | 88.89 | | expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); }); -}); \ No newline at end of file +}); From 5522be31ca820cdeab620e70dc47ecedbd3cce3b Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 19 Mar 2017 01:46:28 +0530 Subject: [PATCH 065/256] Remove hardcoded path separators --- tests/__tests__/ts-coverage-async.spec.ts | 2 +- tests/__tests__/ts-coverage.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index a3e1ac7f11..d7ae4e71c5 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -7,7 +7,7 @@ describe('hello_world', () => { `------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------------|----------|----------|----------|----------|----------------| - simple-async/ | 71.43 | 33.33 | 66.67 | 66.67 | | + simple-async${path.sep} | 71.43 | 33.33 | 66.67 | 66.67 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | ------------------|----------|----------|----------|----------|----------------| diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 89b1d11810..92fccfc2da 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -7,7 +7,7 @@ describe('hello_world', () => { `------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------------|----------|----------|----------|----------|----------------| - simple/ | 71.43 | 33.33 | 66.67 | 66.67 | | + simple${path.sep} | 71.43 | 33.33 | 66.67 | 66.67 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | ------------------|----------|----------|----------|----------|----------------| From a5b8717feff2008ad94e2315e1c0995bed3a82bf Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sun, 19 Mar 2017 01:59:07 +0530 Subject: [PATCH 066/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc771dd482..41de84d820 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.1", + "version": "19.0.2", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From f770e89c6b76a84be9b084f7bc8ff756601cdd55 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 24 Mar 2017 13:53:02 +0530 Subject: [PATCH 067/256] Fix tsc compilation failure due to lodash defn --- tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 7e68d74989..92f6d74376 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "experimentalDecorators": true, "allowSyntheticDefaultImports": false, "outDir": "dist", - "rootDir": "src" + "rootDir": "src", + "skipLibCheck": true }, "include": [ "src/**/*.ts", @@ -26,4 +27,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +} From 7c9375d514e353a506fc13a8003380897ff3e76e Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 24 Mar 2017 14:15:02 +0530 Subject: [PATCH 068/256] write a failing test --- tests/__tests__/tsconfig-comments.spec.ts | 25 +++++++++++++++++++++++ tests/tsconfig-test/allows-comments.json | 5 +++++ 2 files changed, 30 insertions(+) create mode 100644 tests/__tests__/tsconfig-comments.spec.ts create mode 100644 tests/tsconfig-test/allows-comments.json diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts new file mode 100644 index 0000000000..6a1c6dd157 --- /dev/null +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -0,0 +1,25 @@ +import { } from 'jest'; +import { } from 'node'; +import * as ts from 'typescript'; + +jest.mock('path'); + +describe('parse tsconfig with comments', () => { + + beforeEach(() => { + // Set up some mocked out file info before each test + require('path').__setBaseDir('./tests/tsconfig-test'); + }); + + it('should correctly read allow-comments.json', () => { + const { getTSConfig } = require('../../src/utils'); + const result = getTSConfig({ + '__TS_CONFIG__': 'allow-comments.json' + }); + + expect(result).toEqual({ + 'target': ts.ScriptTarget.ES2015 + }); + }); + +}); diff --git a/tests/tsconfig-test/allows-comments.json b/tests/tsconfig-test/allows-comments.json new file mode 100644 index 0000000000..53f77e847c --- /dev/null +++ b/tests/tsconfig-test/allows-comments.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + // some comments + } +} From 78c4d79e24c7402489b83fad74d8ee438e963229 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 24 Mar 2017 14:41:49 +0530 Subject: [PATCH 069/256] fix test --- tests/__tests__/tsconfig-comments.spec.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 6a1c6dd157..cb00b1ef1b 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -13,13 +13,12 @@ describe('parse tsconfig with comments', () => { it('should correctly read allow-comments.json', () => { const { getTSConfig } = require('../../src/utils'); - const result = getTSConfig({ - '__TS_CONFIG__': 'allow-comments.json' - }); - expect(result).toEqual({ - 'target': ts.ScriptTarget.ES2015 - }); + expect(() => { + getTSConfig({ + '__TS_CONFIG__': 'allows-comments.json' + }); + }).not.toThrow(); }); }); From 3c1c50af77209113b6225b7e3275c7f7bb2bf7e5 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 24 Mar 2017 14:49:16 +0530 Subject: [PATCH 070/256] Allow comments in tsconfig --- package.json | 1 + src/utils.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 41de84d820..bef36e7d2f 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "lodash.pickby": "^4.6.0", "remap-istanbul": "^0.7.0", "source-map-support": "^0.4.4", + "tsconfig": "^6.0.0", "yargs": "^6.1.1" }, "peerDependencies": { diff --git a/src/utils.ts b/src/utils.ts index f371fa3928..6e979e4694 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,7 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; +import * as tsconfig from 'tsconfig'; import assign = require('lodash.assign'); const normalize = require('jest-config').normalize; @@ -70,7 +71,8 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { } if (typeof config === 'string') { const configPath = path.resolve(config); - const external = require(configPath); + const fileContent = fs.readFileSync(configPath, 'utf8'); + const external = tsconfig.parse(fileContent, configPath); config = external.compilerOptions || {}; if (typeof external.extends === 'string') { From d5c5646b1dd8c5cf5cb7eda0405e51b062a8dd98 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 24 Mar 2017 14:51:16 +0530 Subject: [PATCH 071/256] Add downloads badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e2dcc2f737..604742cab0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ts-jest +[![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](https://travis-ci.org/kulshekhar/ts-jest) From 03027748c26fbe9483d02e6b58110316b11d4a02 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 24 Mar 2017 15:14:04 +0530 Subject: [PATCH 072/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bef36e7d2f..85f670bd4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.2", + "version": "19.0.3", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 2d03128becceeed7ed7abf20640797f689ae2ae4 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 25 Mar 2017 12:41:27 +0530 Subject: [PATCH 073/256] Test config includes for comments in included file --- tests/tsconfig-test/allows-comments.json | 1 + tests/tsconfig-test/allows-comments2.json | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 tests/tsconfig-test/allows-comments2.json diff --git a/tests/tsconfig-test/allows-comments.json b/tests/tsconfig-test/allows-comments.json index 53f77e847c..0b87e2bff5 100644 --- a/tests/tsconfig-test/allows-comments.json +++ b/tests/tsconfig-test/allows-comments.json @@ -1,4 +1,5 @@ { + "extends": "allows-comments2.json", "compilerOptions": { // some comments } diff --git a/tests/tsconfig-test/allows-comments2.json b/tests/tsconfig-test/allows-comments2.json new file mode 100644 index 0000000000..fe6b094dc2 --- /dev/null +++ b/tests/tsconfig-test/allows-comments2.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + //some comments + } +} From 1a25e7dc506234d8d2202707455d413b937e5199 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 25 Mar 2017 12:44:32 +0530 Subject: [PATCH 074/256] Allow comments in extended tsconfig files --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 6e979e4694..64421c4258 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -77,7 +77,8 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { if (typeof external.extends === 'string') { const parentConfigPath = path.join(path.dirname(configPath), external.extends); - config = Object.assign({}, require(parentConfigPath).compilerOptions, config); + const includedContent = fs.readFileSync(parentConfigPath, 'utf8'); + config = Object.assign({}, tsconfig.parse(includedContent, parentConfigPath).compilerOptions, config); } } From d2b77e64367598667c51f92360b1473f1c18b43d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 25 Mar 2017 12:58:41 +0530 Subject: [PATCH 075/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85f670bd4e..ddd6649922 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.3", + "version": "19.0.4", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 729f415ceabfa26bd08625165c85af9b468a9cb9 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 25 Mar 2017 13:13:46 +0530 Subject: [PATCH 076/256] Harden tests for comments in tsconfig --- tests/__tests__/tsconfig-comments.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index cb00b1ef1b..0ae936e540 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -1,16 +1,36 @@ import { } from 'jest'; import { } from 'node'; import * as ts from 'typescript'; +import * as fs from 'fs'; jest.mock('path'); describe('parse tsconfig with comments', () => { + const configFile1 = './tests/tsconfig-test/allows-comments.json'; + const configFile2 = './tests/tsconfig-test/allows-comments2.json'; beforeEach(() => { // Set up some mocked out file info before each test require('path').__setBaseDir('./tests/tsconfig-test'); }); + it('the two config files should exist', () => { + expect(fs.existsSync(configFile1)).toBe(true); + expect(fs.existsSync(configFile2)).toBe(true); + }); + + it('the two config files should have comments', () => { + // We test for comments by trying to use JSON.parse + // which should fail. + + expect(() => { + JSON.parse(fs.readFileSync(configFile1, 'utf8')); + }).toThrowError(); + expect(() => { + JSON.parse(fs.readFileSync(configFile2, 'utf8')); + }).toThrowError(); + }); + it('should correctly read allow-comments.json', () => { const { getTSConfig } = require('../../src/utils'); From cbdb3f7e26791224c78b9e5891d48ffc72971dc4 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 25 Mar 2017 13:21:26 +0530 Subject: [PATCH 077/256] Check that tests for comments in tsconfig tests extended files --- tests/__tests__/tsconfig-comments.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 0ae936e540..9a534675d3 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -2,6 +2,7 @@ import { } from 'jest'; import { } from 'node'; import * as ts from 'typescript'; import * as fs from 'fs'; +import * as tsconfig from 'tsconfig'; jest.mock('path'); @@ -26,9 +27,18 @@ describe('parse tsconfig with comments', () => { expect(() => { JSON.parse(fs.readFileSync(configFile1, 'utf8')); }).toThrowError(); + expect(() => { JSON.parse(fs.readFileSync(configFile2, 'utf8')); }).toThrowError(); + + }); + + it('one config file should extend the other', () => { + const content = fs.readFileSync(configFile1, 'utf8'); + const config = tsconfig.parse(content, configFile1); + + expect(config.extends).toEqual('allows-comments2.json'); }); it('should correctly read allow-comments.json', () => { From ee2386e597ed3c5f722eea1e9e4fd79ea0341f93 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 25 Mar 2017 08:52:27 +0000 Subject: [PATCH 078/256] chore(package): update dependencies https://greenkeeper.io/ --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ddd6649922..ac6b3a7ad5 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "lodash.includes": "^4.3.0", "lodash.partition": "^4.6.0", "lodash.pickby": "^4.6.0", - "remap-istanbul": "^0.7.0", + "remap-istanbul": "^0.9.5", "source-map-support": "^0.4.4", "tsconfig": "^6.0.0", - "yargs": "^6.1.1" + "yargs": "^7.0.2" }, "peerDependencies": { "typescript": "^2.1.0 || ^2.2.0-dev", From c5c04068d1f89247319b94dc3828108153354aef Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 25 Mar 2017 08:52:30 +0000 Subject: [PATCH 079/256] docs(readme): add Greenkeeper badge https://greenkeeper.io/ --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 604742cab0..5b9a6ab02b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ts-jest +[![Greenkeeper badge](https://badges.greenkeeper.io/kulshekhar/ts-jest.svg)](https://greenkeeper.io/) + [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) From ad37e83c003993e01b411ef006a1c3b5921ad20c Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 25 Mar 2017 14:46:04 +0530 Subject: [PATCH 080/256] Update badges --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b9a6ab02b..f41652afb6 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # 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/) -[![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](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) -[![dependencies](https://david-dm.org/kulshekhar/ts-jest.svg)](https://www.npmjs.com/package/ts-jest) + + ## Table of Contents From 9095b47ffb70d195a445c2ae0519e1c862712af9 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 26 Mar 2017 02:55:59 +0530 Subject: [PATCH 081/256] Create cache directory if it doesn't exist --- src/coverageprocessor.ts | 25 ++++++++++++++----------- tests/__helpers__/runJest.ts | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 5851f75c73..700f0f1e7b 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -7,7 +7,7 @@ const remap = require('remap-istanbul/lib/remap'); const writeReport = require('remap-istanbul/lib/writeReport'); const istanbulInstrument = require('istanbul-lib-instrument'); import pickBy = require('lodash.pickby') -import {getJestConfig} from './utils'; +import { getJestConfig } from './utils'; const glob = require('glob-all'); interface CoverageMap { @@ -18,11 +18,11 @@ interface CoverageMap { } declare const global: { - __ts_coverage__cache__: { - coverageConfig: any; - sourceCache: any[]; - coverageCollectFiles: any[]; - } + __ts_coverage__cache__: { + coverageConfig: any; + sourceCache: any[]; + coverageCollectFiles: any[]; + } }; // full type https://github.com/facebook/jest/blob/master/types/TestResult.js @@ -37,6 +37,9 @@ function processResult(result: Result): Result { let coveredFiles = []; let basepath = path.join(jestConfig.cacheDirectory, '/ts-jest/'); + if (!fs.existsSync(basepath)) { + fs.mkdirSync(basepath) + } let cachedFiles = fs.readdirSync(basepath); cachedFiles.map((p) => { let filename = new Buffer(p.replace(basepath, ''), 'base64').toString('utf8'); @@ -53,18 +56,18 @@ function processResult(result: Result): Result { }; const coverageCollectFiles = - coverageConfig.collectCoverage && + coverageConfig.collectCoverage && jestConfig.testResultsProcessor && jestConfig.collectCoverageFrom && jestConfig.collectCoverageFrom.length ? - glob.sync(jestConfig.collectCoverageFrom).map(x => path.resolve(root, x)) : []; + glob.sync(jestConfig.collectCoverageFrom).map(x => path.resolve(root, x)) : []; if (!coverageConfig.collectCoverage) return result; let coverage; try { coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))]; - } catch(e) { + } catch (e) { return result; } @@ -73,7 +76,7 @@ function processResult(result: Result): Result { // //generate 'empty' coverage against uncovered files. // //If source is non-ts passed by allowJS, return empty since not able to lookup from cache - const emptyCoverage = uncoveredFiles.map((x:string) => { + const emptyCoverage = uncoveredFiles.map((x: string) => { let ret = {}; if (sourceCache[x]) { let instrumenter = istanbulInstrument.createInstrumenter(); @@ -100,4 +103,4 @@ function processResult(result: Result): Result { return result; } -module.exports = processResult; \ No newline at end of file +module.exports = processResult; diff --git a/tests/__helpers__/runJest.ts b/tests/__helpers__/runJest.ts index fee8b0ed8a..d8a0f8271a 100644 --- a/tests/__helpers__/runJest.ts +++ b/tests/__helpers__/runJest.ts @@ -1,6 +1,6 @@ // from: https://github.com/facebook/jest/blob/master/integration_tests/runJest.js -const {fileExists} = require('./utils'); +const { fileExists } = require('./utils'); const path = require('path'); const spawnSync = require('cross-spawn').sync; @@ -36,4 +36,4 @@ export default function runJest(dir, args) { result.stderr = result.stderr && result.stderr.toString(); return result; -} \ No newline at end of file +} From b19dda8c3c36495083166b7abf11b8c64f332756 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sun, 26 Mar 2017 03:08:14 +0530 Subject: [PATCH 082/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac6b3a7ad5..d875847f3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.4", + "version": "19.0.5", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 5a87d5af2df2595297245514f362f2d0ba33c940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 14:18:46 +0200 Subject: [PATCH 083/256] Support transforming html --- README.md | 25 ++++++++++++++++++++++++- src/preprocessor.ts | 13 +++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f41652afb6..4b4720cac8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ts-jest -[![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/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/) @@ -122,6 +122,29 @@ Or even declare options for `tsc` instead of using separate config, like this: ``` Note that the `module` property will be overwritten to `commonjs` since that is the format Jest expects. +When using Jest with Angular (a.k.a Angular 2) apps you will likely need to parse HTML templates. If you're unable to add `html-loader` to webpack config (e.g. because you don't want to eject from `angular-cli`) you can do so by defining `__TRANSFORM_HTML__` key in `globals` for `jest`. + +```json +{ + "jest": { + "globals": { + "__TRANSFORM_HTML__": true + } + } +} +``` + +You'll also need to extend your `transform` regex with `html` extension: +```json +{ + "jest": { + "transform": { + "^.+\\.(ts|tsx|js|html)$": "/node_modules/ts-jest/preprocessor.js" + } + } +} +``` + For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). ### Known limitations for TS compiler options diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 50a5f86a01..eee28c2e41 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -7,14 +7,19 @@ const nodepath = require('path'); export function process(src, path, config) { const compilerOptions = getTSConfig(config.globals, config.collectCoverage); - + const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); - - const processFile = compilerOptions.allowJs === true + const isHtmlFile = path.endsWith('.html'); + + if (isHtmlFile && config.__TRANSFORM_HTML__) { + src = 'module.exports=`' + src + '`;'; + } + + const processFile = compilerOptions.allowJs === true ? isTsFile || isJsFile : isTsFile; - + if (processFile) { const transpiled = tsc.transpileModule( src, From 86c542b28b488595dccd171992c0c5783230c802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 15:26:31 +0200 Subject: [PATCH 084/256] Add test for html transform --- src/preprocessor.ts | 2 +- .../__snapshots__/html-file.spec.ts.snap | 7 +++++++ tests/html-test/__tests__/html-file.spec.ts | 12 ++++++++++++ tests/html-test/package.json | 17 +++++++++++++++++ tests/html-test/tsconfig.json | 11 +++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap create mode 100644 tests/html-test/__tests__/html-file.spec.ts create mode 100644 tests/html-test/package.json create mode 100644 tests/html-test/tsconfig.json diff --git a/src/preprocessor.ts b/src/preprocessor.ts index eee28c2e41..9ad955d367 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -12,7 +12,7 @@ export function process(src, path, config) { const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); - if (isHtmlFile && config.__TRANSFORM_HTML__) { + if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { src = 'module.exports=`' + src + '`;'; } diff --git a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap new file mode 100644 index 0000000000..49fffca486 --- /dev/null +++ b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`html to be transformed 1`] = ` +"module.exports=\`
+ This is element +
\`;" +`; diff --git a/tests/html-test/__tests__/html-file.spec.ts b/tests/html-test/__tests__/html-file.spec.ts new file mode 100644 index 0000000000..b518a1f8ca --- /dev/null +++ b/tests/html-test/__tests__/html-file.spec.ts @@ -0,0 +1,12 @@ +import {process} from '../../../preprocessor'; +const config = require('../package.json'); + +test('html to be transformed', () => { + const source = +`
+ This is element +
`; + const path = '/path/to/file.html'; + + expect(process(source, path, config.jest)).toMatchSnapshot(); +}); diff --git a/tests/html-test/package.json b/tests/html-test/package.json new file mode 100644 index 0000000000..af0497cd46 --- /dev/null +++ b/tests/html-test/package.json @@ -0,0 +1,17 @@ +{ + "jest": { + "globals": { + "__TRANSFORM_HTML__": true + }, + "transform": { + ".(ts|tsx|html)": "../../preprocessor.js" + }, + "moduleDirectories": ["node_modules", "src"], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/html-test/tsconfig.json b/tests/html-test/tsconfig.json new file mode 100644 index 0000000000..5319633fc9 --- /dev/null +++ b/tests/html-test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true, + "baseUrl": "src" + } +} From 72e0e56b4d7da6829362bc6d2c6946e571a91497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 15:34:14 +0200 Subject: [PATCH 085/256] Update test --- .../__tests__/__snapshots__/html-file.spec.ts.snap | 6 ++++++ tests/html-test/__tests__/html-file.spec.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap index 49fffca486..ed426c0b35 100644 --- a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap +++ b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap @@ -5,3 +5,9 @@ exports[`html to be transformed 1`] = ` This is element \`;" `; + +exports[`html to be transformed 2`] = ` +"
+ This is element +
" +`; diff --git a/tests/html-test/__tests__/html-file.spec.ts b/tests/html-test/__tests__/html-file.spec.ts index b518a1f8ca..a4bdd60b1f 100644 --- a/tests/html-test/__tests__/html-file.spec.ts +++ b/tests/html-test/__tests__/html-file.spec.ts @@ -1,7 +1,7 @@ import {process} from '../../../preprocessor'; const config = require('../package.json'); -test('html to be transformed', () => { +test('transforms html if config.globals.__TRANSFORM_HTML__ is set', () => { const source = `
This is element @@ -9,4 +9,6 @@ test('html to be transformed', () => { const path = '/path/to/file.html'; expect(process(source, path, config.jest)).toMatchSnapshot(); + delete config.jest.globals.__TRANSFORM_HTML__; + expect(process(source, path, config.jest)).toMatchSnapshot(); }); From 16a7d73d68567f485955fb13e0bcfb57aac70f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 15:36:00 +0200 Subject: [PATCH 086/256] Update snapshots --- .../html-test/__tests__/__snapshots__/html-file.spec.ts.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap index ed426c0b35..d2ed4c69ff 100644 --- a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap +++ b/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`html to be transformed 1`] = ` +exports[`transforms html if config.globals.__TRANSFORM_HTML__ is set 1`] = ` "module.exports=\`
This is element
\`;" `; -exports[`html to be transformed 2`] = ` +exports[`transforms html if config.globals.__TRANSFORM_HTML__ is set 2`] = ` "
This is element
" From bb286eeede71643f76b349e65a6c162c5a8a8430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 17:01:24 +0200 Subject: [PATCH 087/256] Put test into correct location --- .../html-transform.spec.ts.snap} | 0 tests/__tests__/html-transform.spec.ts | 27 +++++++++++++++++++ tests/html-test/__tests__/html-file.spec.ts | 14 ---------- tests/html-test/package.json | 17 ------------ tests/html-test/tsconfig.json | 11 -------- 5 files changed, 27 insertions(+), 42 deletions(-) rename tests/{html-test/__tests__/__snapshots__/html-file.spec.ts.snap => __tests__/__snapshots__/html-transform.spec.ts.snap} (100%) create mode 100644 tests/__tests__/html-transform.spec.ts delete mode 100644 tests/html-test/__tests__/html-file.spec.ts delete mode 100644 tests/html-test/package.json delete mode 100644 tests/html-test/tsconfig.json diff --git a/tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap b/tests/__tests__/__snapshots__/html-transform.spec.ts.snap similarity index 100% rename from tests/html-test/__tests__/__snapshots__/html-file.spec.ts.snap rename to tests/__tests__/__snapshots__/html-transform.spec.ts.snap diff --git a/tests/__tests__/html-transform.spec.ts b/tests/__tests__/html-transform.spec.ts new file mode 100644 index 0000000000..7c02fb3b93 --- /dev/null +++ b/tests/__tests__/html-transform.spec.ts @@ -0,0 +1,27 @@ +import {process} from '../../src/preprocessor'; + +const source = +`
+ This is element +
`; +const path = '/path/to/file.html'; +const config = { + globals: { + __TRANSFORM_HTML__: true + }, + transform: { + ".(ts|tsx|html)": "/node_modules/ts-jest/preprocessor.js" + }, + testRegex: "/specs/.*\\.spec\\.(ts|tsx|js)$", + moduleFileExtensions: [ + "ts", + "tsx", + "js" + ] +}; + +test('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(); +}); diff --git a/tests/html-test/__tests__/html-file.spec.ts b/tests/html-test/__tests__/html-file.spec.ts deleted file mode 100644 index a4bdd60b1f..0000000000 --- a/tests/html-test/__tests__/html-file.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {process} from '../../../preprocessor'; -const config = require('../package.json'); - -test('transforms html if config.globals.__TRANSFORM_HTML__ is set', () => { - const source = -`
- This is element -
`; - const path = '/path/to/file.html'; - - expect(process(source, path, config.jest)).toMatchSnapshot(); - delete config.jest.globals.__TRANSFORM_HTML__; - expect(process(source, path, config.jest)).toMatchSnapshot(); -}); diff --git a/tests/html-test/package.json b/tests/html-test/package.json deleted file mode 100644 index af0497cd46..0000000000 --- a/tests/html-test/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "jest": { - "globals": { - "__TRANSFORM_HTML__": true - }, - "transform": { - ".(ts|tsx|html)": "../../preprocessor.js" - }, - "moduleDirectories": ["node_modules", "src"], - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js" - ] - } -} diff --git a/tests/html-test/tsconfig.json b/tests/html-test/tsconfig.json deleted file mode 100644 index 5319633fc9..0000000000 --- a/tests/html-test/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "ES5", - "module": "commonjs", - "moduleResolution": "node", - "noEmitOnError": false, - "jsx": "react", - "allowJs": true, - "baseUrl": "src" - } -} From 7a81dc88e742c69eed9713cd9f14dd3fd468e05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 27 Mar 2017 17:02:51 +0200 Subject: [PATCH 088/256] Simplify test --- tests/__tests__/html-transform.spec.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/__tests__/html-transform.spec.ts b/tests/__tests__/html-transform.spec.ts index 7c02fb3b93..9305bbf0b8 100644 --- a/tests/__tests__/html-transform.spec.ts +++ b/tests/__tests__/html-transform.spec.ts @@ -8,16 +8,7 @@ const path = '/path/to/file.html'; const config = { globals: { __TRANSFORM_HTML__: true - }, - transform: { - ".(ts|tsx|html)": "/node_modules/ts-jest/preprocessor.js" - }, - testRegex: "/specs/.*\\.spec\\.(ts|tsx|js)$", - moduleFileExtensions: [ - "ts", - "tsx", - "js" - ] + } }; test('transforms html if config.globals.__TRANSFORM_HTML__ is set', () => { From 8eb2f046470dfa91c1cc84b7f73bf78a96ac0bc6 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Mon, 27 Mar 2017 21:27:12 +0530 Subject: [PATCH 089/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d875847f3a..77d46fe902 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.5", + "version": "19.0.6", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 33ebc9299214ddbf19c1f178f8b567aa342d1e5e Mon Sep 17 00:00:00 2001 From: Umidbek Karimov Date: Thu, 30 Mar 2017 17:58:05 +0400 Subject: [PATCH 090/256] Add note about remapped coverage reports directory See https://stackoverflow.com/questions/41188484/jest-typescript-ts-jest-coverage-is-slightly-incorrect --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b4720cac8..2ef6e9608b 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,9 @@ By default `jest` does not provide code coverage remapping for transpiled codes, } ``` -> **Note:** If you're experiencing remapping failure with source lookup, it may due to pre-created cache from `jest`. It can be manually deleted, or execute with [`--no-cache`](https://facebook.github.io/jest/docs/troubleshooting.html#caching-issues) to not use those. +> **Notes:** +> * If you're experiencing remapping failure with source lookup, it may due to pre-created cache from `jest`. It can be manually deleted, or execute with [`--no-cache`](https://facebook.github.io/jest/docs/troubleshooting.html#caching-issues) to not use those. +> * Remapped reports will be copied to `remapped` directory in coverage directory (e.g. `coverage/remapped`). ### React Native From 8fc665abc787e957233092693c6fda5d4284ba2d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 30 Mar 2017 19:38:56 +0530 Subject: [PATCH 091/256] Update AUTHORS Add @umidbekkarimov to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 3b603cee94..cda8f8d779 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,3 +17,4 @@ Kulshekhar Kabra Maxim Samoilov OJ Kwon Tom Crockett +Umidbek Karimov From dfccf03d632590eb4a757cf9b946da5117476291 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 30 Mar 2017 21:52:20 +0530 Subject: [PATCH 092/256] Use standard Travis badge --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 2ef6e9608b..ec12038515 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@ [![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 node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest) -[![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest) -[![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](https://travis-ci.org/kulshekhar/ts-jest) +[![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) From c8b06bba0b167b16f25966dbd1fb2fc99df8dc66 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Apr 2017 11:44:25 +0530 Subject: [PATCH 093/256] Add sample configs to run tests against --- tests/tsconfig-test/tsconfig-module/custom-config.json | 5 +++++ tests/tsconfig-test/tsconfig-module/tsconfig.json | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 tests/tsconfig-test/tsconfig-module/custom-config.json create mode 100644 tests/tsconfig-test/tsconfig-module/tsconfig.json diff --git a/tests/tsconfig-test/tsconfig-module/custom-config.json b/tests/tsconfig-test/tsconfig-module/custom-config.json new file mode 100644 index 0000000000..8b536811db --- /dev/null +++ b/tests/tsconfig-test/tsconfig-module/custom-config.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "module": "es2015" + } +} diff --git a/tests/tsconfig-test/tsconfig-module/tsconfig.json b/tests/tsconfig-test/tsconfig-module/tsconfig.json new file mode 100644 index 0000000000..8b536811db --- /dev/null +++ b/tests/tsconfig-test/tsconfig-module/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "module": "es2015" + } +} From 2f15f2f07975b6618501d445b19a4c1517d87fcc Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Apr 2017 11:44:52 +0530 Subject: [PATCH 094/256] Add tests for 'module' property from various sources --- tests/__tests__/tsconfig-default.spec.ts | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index 85f4bb822d..7dd4d2254a 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -63,7 +63,7 @@ describe('get default ts config', () => { expect(result).toEqual(resultNullContent); }); - it('should set the module to CommonJS if it is not', () => { + it('should not change the module if it is loaded from the Jest config global', () => { const { getTSConfig } = require('../../src/utils'); const config = getTSConfig({ '__TS_CONFIG__': { @@ -71,6 +71,30 @@ describe('get default ts config', () => { } }); + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should not change the module if it is loaded from a non-default config file', () => { + const { getTSConfig } = require('../../src/utils'); + const config = getTSConfig({ + '__TS_CONFIG__': 'tsconfig-module/custom-config.json' + }); + + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { + + // set the base directory such that we can use 'tsconfig.json' as the + // config file name instead of 'dir/tsconfig.json' + require('path').__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + + const { getTSConfig } = require('../../src/utils'); + + const config = getTSConfig({ + '__TS_CONFIG__': 'tsconfig.json' + }); + expect(config.module).toBe(ts.ModuleKind.CommonJS); }); From d26dbf6ff0b10a1a30f74274caef67e55d43bc29 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Apr 2017 11:45:26 +0530 Subject: [PATCH 095/256] Hardcode module to commonjs if not set explicitly --- src/utils.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 64421c4258..2065eb4caf 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -65,12 +65,11 @@ export function getJestConfig(root) { } export function getTSConfig(globals, collectCoverage: boolean = false) { - let config = (globals && globals.__TS_CONFIG__) ? globals.__TS_CONFIG__ : undefined; - if (config === undefined) { - config = 'tsconfig.json'; - } + let config = (globals && globals.__TS_CONFIG__) ? globals.__TS_CONFIG__ : 'tsconfig.json'; + if (typeof config === 'string') { - const configPath = path.resolve(config); + const configFileName = config; + const configPath = path.resolve(configFileName); const fileContent = fs.readFileSync(configPath, 'utf8'); const external = tsconfig.parse(fileContent, configPath); config = external.compilerOptions || {}; @@ -80,9 +79,16 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { const includedContent = fs.readFileSync(parentConfigPath, 'utf8'); config = Object.assign({}, tsconfig.parse(includedContent, parentConfigPath).compilerOptions, config); } + + if (configFileName === '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 + // the global __TS_CONFIG__ setting in Jest config + config.module = 'commonjs'; + } } - config.module = 'commonjs'; config.jsx = config.jsx || tsc.JsxEmit.React; //inline source with source map for remapping coverage From bd315a36f23945efab04eb212b0e1658ca54a19e Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Apr 2017 11:45:54 +0530 Subject: [PATCH 096/256] Update the README info about the module property --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec12038515..dd84d4090b 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Or even declare options for `tsc` instead of using separate config, like this: } } ``` -Note that the `module` property will be overwritten to `commonjs` since that is the format Jest expects. +Note that if you haven't explicitly set the `module` property in the `__TS_CONFIG__` setting (either directly or through a separate configuration file), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. When using Jest with Angular (a.k.a Angular 2) apps you will likely need to parse HTML templates. If you're unable to add `html-loader` to webpack config (e.g. because you don't want to eject from `angular-cli`) you can do so by defining `__TRANSFORM_HTML__` key in `globals` for `jest`. From c776c8d84b77339579340da153403121d8569f0d Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Apr 2017 11:59:02 +0530 Subject: [PATCH 097/256] Bump npm version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77d46fe902..86171850c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.6", + "version": "19.0.7", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From c2cb666086a5c737154e96df3cff8c83435e2c20 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 5 Apr 2017 03:05:43 +0530 Subject: [PATCH 098/256] Set inlineSourceMap to true unless it has been set to false --- src/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 2065eb4caf..40833e7115 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -89,6 +89,10 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { } } + if (config.inlineSourceMap !== false) { + config.inlineSourceMap = true; + } + config.jsx = config.jsx || tsc.JsxEmit.React; //inline source with source map for remapping coverage From df307f1197376978e8e30137cb2322eeed7d7ab2 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 5 Apr 2017 03:34:09 +0530 Subject: [PATCH 099/256] Update tests to account for inlineSourceMap --- tests/__tests__/tsconfig-default.spec.ts | 1 + tests/__tests__/tsconfig-inline.spec.ts | 13 +++++++------ tests/__tests__/tsconfig-string.spec.ts | 23 +++++++++++++---------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index 7dd4d2254a..5c42c5f80b 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -16,6 +16,7 @@ describe('get default ts config', () => { const result = getTSConfig(); expect(result).toEqual({ + 'inlineSourceMap': true, 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index d7b6e8c285..62d8791482 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -12,7 +12,7 @@ describe('get inline ts config', () => { }); it('should correctly read inline tsconfig options', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', @@ -20,14 +20,15 @@ describe('get inline ts config', () => { } }); - expect(result).toEqual ({ + expect(result).toEqual({ + 'inlineSourceMap': true, 'module': ts.ModuleKind.CommonJS, 'jsx': ts.JsxEmit.React }); }); it('should not read tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', @@ -35,7 +36,7 @@ describe('get inline ts config', () => { } }); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -45,7 +46,7 @@ describe('get inline ts config', () => { }); it('should not read my-tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', @@ -53,7 +54,7 @@ describe('get inline ts config', () => { } }); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index 519ff1012f..3b1b72f0ab 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -12,12 +12,13 @@ describe('get ts config from string', () => { }); it('should correctly read my-tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); - expect(result).toEqual ({ + expect(result).toEqual({ + 'inlineSourceMap': true, 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -27,12 +28,12 @@ describe('get ts config from string', () => { }); it('should not read tsconfig.json', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -42,24 +43,25 @@ describe('get ts config from string', () => { }); it('should not read inline tsconfig options', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); - expect(result).not.toEqual ({ + expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES5, 'jsx': ts.JsxEmit.React }); }); it('should correctly resolve the "extends" directive', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'extends-tsconfig.json' }); - expect(result).toEqual ({ + expect(result).toEqual({ + 'inlineSourceMap': true, 'target': ts.ScriptTarget.ES2015, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, @@ -69,12 +71,13 @@ describe('get ts config from string', () => { }); it('should correctly override any config in the "extends" directive', () => { - const {getTSConfig} = require('../../src/utils'); + const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'extends-with-overrides-tsconfig.json' }); - expect(result).toEqual ({ + expect(result).toEqual({ + 'inlineSourceMap': true, 'target': ts.ScriptTarget.ES5, 'module': ts.ModuleKind.CommonJS, 'moduleResolution': ts.ModuleResolutionKind.NodeJs, From c51ae0d65968e878f645f2d376912d11780264a4 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 6 Apr 2017 01:55:47 +0530 Subject: [PATCH 100/256] Set module to commonjs if it isn't set --- src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 40833e7115..cd97232e0a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -88,6 +88,8 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config.module = 'commonjs'; } } + + config.module = config.module || 'commonjs'; if (config.inlineSourceMap !== false) { config.inlineSourceMap = true; From 7defcd4860e09024025d99bb9b5659fd1c10bb06 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 6 Apr 2017 01:56:39 +0530 Subject: [PATCH 101/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 86171850c4..4d25f525a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.7", + "version": "19.0.8", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 1f9016214fe5b0546b322af0d0944f0a9bd0df70 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 8 Apr 2017 02:40:19 +0530 Subject: [PATCH 102/256] configure git on appveyor to allow long paths --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 583130c035..2e463ce502 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,7 @@ version: "{build}" # fix lineendings in Windows init: - git config --global core.autocrlf input + - git config --system core.longpaths true # what combinations to test environment: @@ -29,4 +30,4 @@ build: off test_script: - node --version - npm --version - - cmd: npm test --no-color \ No newline at end of file + - cmd: npm test --no-color From 1c3bf3dad9bee09bc12bc0c34fa08ce092dc2925 Mon Sep 17 00:00:00 2001 From: Andreas Krummsdorf Date: Mon, 10 Apr 2017 13:04:52 +0200 Subject: [PATCH 103/256] Strip package root part of filename before encoding the filename for the cache Closes #158 --- src/coverageprocessor.ts | 2 ++ src/preprocessor.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 700f0f1e7b..6fd6f21680 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -43,6 +43,8 @@ function processResult(result: Result): Result { let cachedFiles = fs.readdirSync(basepath); cachedFiles.map((p) => { let filename = new Buffer(p.replace(basepath, ''), 'base64').toString('utf8'); + // add back root part of filename + filename = root + filename; coveredFiles.push(filename); sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); }); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 9ad955d367..37bf3104ee 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -6,6 +6,7 @@ const glob = require('glob-all'); const nodepath = require('path'); export function process(src, path, config) { + const root = require('jest-util').getPackageRoot(); const compilerOptions = getTSConfig(config.globals, config.collectCoverage); const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); @@ -28,6 +29,9 @@ export function process(src, path, config) { fileName: path }); + // strip root part from path + path = path.replace(root, ''); + //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', new Buffer(path).toString('base64')), transpiled.outputText); From 844fa419580350691a4f391b462239760b417d62 Mon Sep 17 00:00:00 2001 From: Daniel Perez Alvarez Date: Mon, 10 Apr 2017 19:58:45 -0700 Subject: [PATCH 104/256] Remove unnecessary `^2.2.0-dev` for `typescript` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d25f525a3..5e8d6b6ace 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "yargs": "^7.0.2" }, "peerDependencies": { - "typescript": "^2.1.0 || ^2.2.0-dev", + "typescript": "^2.1.0", "jest": "^19.0.0" }, "devDependencies": { From 89b8874b2cfbfcca123bed629adf22ed0218f3ce Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 12 Apr 2017 16:51:54 +0530 Subject: [PATCH 105/256] Update AUTHORS Add @unindented to authors list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index cda8f8d779..9fe97e9b1c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -7,6 +7,7 @@ Alex Jover Morales Bartosz Gościński Blake Embrey Chong Guo +Daniel Perez Alvarez Emil Persson Eric Anderson Felipe Matos From 1be4ef82c10ebf621322db5380088e61cf0bffb7 Mon Sep 17 00:00:00 2001 From: Andreas Krummsdorf Date: Thu, 13 Apr 2017 09:09:47 +0200 Subject: [PATCH 106/256] Add comments and cleanup code --- src/coverageprocessor.ts | 7 +++++-- src/preprocessor.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 6fd6f21680..66353f074a 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -6,7 +6,7 @@ const loadCoverage = require('remap-istanbul/lib/loadCoverage'); const remap = require('remap-istanbul/lib/remap'); const writeReport = require('remap-istanbul/lib/writeReport'); const istanbulInstrument = require('istanbul-lib-instrument'); -import pickBy = require('lodash.pickby') +import pickBy = require('lodash.pickby'); import { getJestConfig } from './utils'; const glob = require('glob-all'); @@ -38,12 +38,15 @@ function processResult(result: Result): Result { let basepath = path.join(jestConfig.cacheDirectory, '/ts-jest/'); if (!fs.existsSync(basepath)) { - fs.mkdirSync(basepath) + fs.mkdirSync(basepath); } let cachedFiles = fs.readdirSync(basepath); cachedFiles.map((p) => { let filename = new Buffer(p.replace(basepath, ''), 'base64').toString('utf8'); // add back root part of filename + // the root part was removed in the preprocessor.ts file to get shorter file names + // long file names could be problematic in some OS + // see https://github.com/kulshekhar/ts-jest/issues/158 filename = root + filename; coveredFiles.push(filename); sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 37bf3104ee..5e77d0bbd2 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -30,7 +30,10 @@ export function process(src, path, config) { }); // strip root part from path - path = path.replace(root, ''); + // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter + // long file names could be problematic in some OS + // see https://github.com/kulshekhar/ts-jest/issues/158 + path = path.startsWith(root) ? path.substr(root.length) : path; //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { From 3d1f50510155804b6e6d7375b3d8681c1f36d9c7 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 13 Apr 2017 17:59:27 +0530 Subject: [PATCH 107/256] Add tests for long paths --- tests/__tests__/long-path.spec.ts | 27 +++++++++++++++++++ .../Hello.ts | 3 +++ .../NullCoverage.js | 6 +++++ .../__tests__/Hello.test.ts | 7 +++++ .../package.json | 21 +++++++++++++++ .../tsconfig.json | 10 +++++++ 6 files changed, 74 insertions(+) create mode 100644 tests/__tests__/long-path.spec.ts create mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts create mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js create mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts create mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json create mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts new file mode 100644 index 0000000000..dc92a81f91 --- /dev/null +++ b/tests/__tests__/long-path.spec.ts @@ -0,0 +1,27 @@ +import runJest from '../__helpers__/runJest'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('Long (but not too long) path', () => { + const snapshot = + `---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| + simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | + Hello.ts | 100 | 100 | 100 | 100 | | + NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +All files | 57.14 | 0 | 66.67 | 50 | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +`; + + it('should work as expected', () => { + runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); + + const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); + + expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); + expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); + }); + +}); diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts new file mode 100644 index 0000000000..9c4322b72b --- /dev/null +++ b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts @@ -0,0 +1,3 @@ +export class Hello { + name: string = 'John Doe'; +} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js new file mode 100644 index 0000000000..c59dbbdef3 --- /dev/null +++ b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js @@ -0,0 +1,6 @@ +function nullCoverageFunction(value) { + if (value) { + return value; + } + return null; +} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts new file mode 100644 index 0000000000..be56b29b4f --- /dev/null +++ b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts @@ -0,0 +1,7 @@ +import { Hello } from '../Hello'; + +describe('Hello test in long path', () => { + it('should work', () => { + expect(new Hello().name).toEqual('John Doe'); + }) +}) diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json new file mode 100644 index 0000000000..e881f09b1b --- /dev/null +++ b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json @@ -0,0 +1,21 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testResultsProcessor": "../../coverageprocessor.js", + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "coverageReporters": [ + "json" + ], + "collectCoverageFrom": [ + "Hello.ts", + "NullCoverage.js" + ], + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json new file mode 100644 index 0000000000..55f8667f97 --- /dev/null +++ b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true + } +} From 36cd46465adc8824e32e96981af01d064a31725c Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 13 Apr 2017 18:43:23 +0530 Subject: [PATCH 108/256] Reduce the pathname for testing on windows --- src/coverageprocessor.ts | 2 +- src/preprocessor.ts | 6 ++--- tests/__tests__/long-path.spec.ts | 22 +++++++++---------- .../Hello.ts | 0 .../NullCoverage.js | 0 .../__tests__/Hello.test.ts | 0 .../package.json | 0 .../tsconfig.json | 0 8 files changed, 15 insertions(+), 15 deletions(-) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/Hello.ts (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/NullCoverage.js (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/__tests__/Hello.test.ts (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/package.json (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/tsconfig.json (100%) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 66353f074a..17c4087f30 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -47,7 +47,7 @@ function processResult(result: Result): Result { // the root part was removed in the preprocessor.ts file to get shorter file names // long file names could be problematic in some OS // see https://github.com/kulshekhar/ts-jest/issues/158 - filename = root + filename; + // filename = root + filename; coveredFiles.push(filename); sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); }); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 5e77d0bbd2..51ad067279 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; -import {getTSConfig} from './utils'; +import { getTSConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); @@ -14,7 +14,7 @@ export function process(src, path, config) { const isHtmlFile = path.endsWith('.html'); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { - src = 'module.exports=`' + src + '`;'; + src = 'module.exports=`' + src + '`;'; } const processFile = compilerOptions.allowJs === true @@ -33,7 +33,7 @@ export function process(src, path, config) { // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter // long file names could be problematic in some OS // see https://github.com/kulshekhar/ts-jest/issues/158 - path = path.startsWith(root) ? path.substr(root.length) : path; + // path = path.startsWith(root) ? path.substr(root.length) : path; //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts index dc92a81f91..8bcdadb9bc 100644 --- a/tests/__tests__/long-path.spec.ts +++ b/tests/__tests__/long-path.spec.ts @@ -4,21 +4,21 @@ import * as path from 'path'; describe('Long (but not too long) path', () => { const snapshot = - `---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| - simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | - Hello.ts | 100 | 100 | 100 | 100 | | - NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -All files | 57.14 | 0 | 66.67 | 50 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| + `------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| + simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | + Hello.ts | 100 | 100 | 100 | 100 | | + NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +All files | 57.14 | 0 | 66.67 | 50 | | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| `; it('should work as expected', () => { - runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); + runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); - const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); + const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json From d0d70266d49b5f14e34e8c9a47e4a2c6445f7328 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 13 Apr 2017 18:50:34 +0530 Subject: [PATCH 109/256] Get tests for long paths to fail on appveyor --- tests/__tests__/long-path.spec.ts | 22 +++++++++---------- .../Hello.ts | 0 .../NullCoverage.js | 0 .../__tests__/Hello.test.ts | 0 .../package.json | 0 .../tsconfig.json | 0 6 files changed, 11 insertions(+), 11 deletions(-) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/Hello.ts (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/NullCoverage.js (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/__tests__/Hello.test.ts (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/package.json (100%) rename tests/{simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long => simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long}/tsconfig.json (100%) diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts index 8bcdadb9bc..0d07ed0f55 100644 --- a/tests/__tests__/long-path.spec.ts +++ b/tests/__tests__/long-path.spec.ts @@ -4,21 +4,21 @@ import * as path from 'path'; describe('Long (but not too long) path', () => { const snapshot = - `------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| - simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | - Hello.ts | 100 | 100 | 100 | 100 | | - NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -All files | 57.14 | 0 | 66.67 | 50 | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| + `-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| + simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | + Hello.ts | 100 | 100 | 100 | 100 | | + NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| +All files | 57.14 | 0 | 66.67 | 50 | | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| `; it('should work as expected', () => { - runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); + runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); - const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); + const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json similarity index 100% rename from tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json rename to tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json From 0c9e2e4f7a6cebdf47dd06208e050652420f4faa Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 13 Apr 2017 18:52:43 +0530 Subject: [PATCH 110/256] Uncomment fix for long paths --- src/coverageprocessor.ts | 2 +- src/preprocessor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 17c4087f30..66353f074a 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -47,7 +47,7 @@ function processResult(result: Result): Result { // the root part was removed in the preprocessor.ts file to get shorter file names // long file names could be problematic in some OS // see https://github.com/kulshekhar/ts-jest/issues/158 - // filename = root + filename; + filename = root + filename; coveredFiles.push(filename); sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); }); diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 51ad067279..994f6b09b5 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -33,7 +33,7 @@ export function process(src, path, config) { // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter // long file names could be problematic in some OS // see https://github.com/kulshekhar/ts-jest/issues/158 - // path = path.startsWith(root) ? path.substr(root.length) : path; + path = path.startsWith(root) ? path.substr(root.length) : path; //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { From 6e59676700dc17bbb7c39d1ca7d84c852f4314ea Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 13 Apr 2017 19:04:19 +0530 Subject: [PATCH 111/256] Use platform neutral path separator --- tests/__tests__/long-path.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts index 0d07ed0f55..5e8627b668 100644 --- a/tests/__tests__/long-path.spec.ts +++ b/tests/__tests__/long-path.spec.ts @@ -7,7 +7,7 @@ describe('Long (but not too long) path', () => { `-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| - simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/ | 57.14 | 0 | 66.67 | 50 | | + simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long${path.sep} | 57.14 | 0 | 66.67 | 50 | | Hello.ts | 100 | 100 | 100 | 100 | | NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| From 1b283f7b755fd63b2e69f015ff6f392d26e40522 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 13 Apr 2017 19:26:11 +0530 Subject: [PATCH 112/256] Update AUTHORS Add @4kochi to authors list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 9fe97e9b1c..ee06adbd62 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ # Name/Organization Alex Jover Morales +Andreas Krummsdorf Bartosz Gościński Blake Embrey Chong Guo From 9c5a34cfa276956ec8f21de9f7649e5552bd2637 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 13 Apr 2017 19:26:44 +0530 Subject: [PATCH 113/256] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e8d6b6ace..4a95ff27bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.8", + "version": "19.0.9", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From a481ae249a6c229dfd2ca07ce7577113b8366f4a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Mon, 17 Apr 2017 01:22:19 +0530 Subject: [PATCH 114/256] Add tests for coverage processor with custom directory --- tests/__tests__/ts-coverage.spec.ts | 8 ++++++++ tests/simple/.gitignore | 1 + tests/simple/with-coverage-dir.json | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/simple/.gitignore create mode 100644 tests/simple/with-coverage-dir.json diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 92fccfc2da..31559f0291 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -24,4 +24,12 @@ All files | 71.43 | 33.33 | 66.67 | 66.67 | | expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); }); + it('should run successfully with a custom coverage directory', () => { + runJest('../simple', ['--no-cache', '--coverage', '--config', '../simple/with-coverage-dir.json']); + + const coveragePath = path.resolve('./tests/simple/coverage-custom/remapped/coverage.txt'); + + expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); + }); + }); diff --git a/tests/simple/.gitignore b/tests/simple/.gitignore new file mode 100644 index 0000000000..9e233d795a --- /dev/null +++ b/tests/simple/.gitignore @@ -0,0 +1 @@ +coverage-custom diff --git a/tests/simple/with-coverage-dir.json b/tests/simple/with-coverage-dir.json new file mode 100644 index 0000000000..c2fed527e2 --- /dev/null +++ b/tests/simple/with-coverage-dir.json @@ -0,0 +1,20 @@ +{ + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testResultsProcessor": "../../coverageprocessor.js", + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ], + "coverageDirectory": "coverage-custom", + "collectCoverageFrom": [ + "Hello.ts", + "NullCoverage.js" + ], + "coverageReporters": [ + "text" + ] +} From ce22900a989d83ca8c99c754830b23f6610c30c1 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Mon, 17 Apr 2017 01:22:48 +0530 Subject: [PATCH 115/256] Fix text coverage report generation --- src/coverageprocessor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 66353f074a..4fd6630acb 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -56,7 +56,7 @@ function processResult(result: Result): Result { const coverageConfig = { collectCoverage: jestConfig.collectCoverage ? jestConfig.collectCoverage : true, - coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : './coverage/', + coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : path.join(root, 'coverage'), coverageReporters: jestConfig.coverageReporters }; @@ -104,7 +104,7 @@ function processResult(result: Result): Result { writeReport(coverageCollector, 'html', {}, path.join(coverageOutputPath, 'html')); writeReport(coverageCollector, 'lcovonly', {}, path.join(coverageOutputPath, 'lcov.info')); writeReport(coverageCollector, 'json', {}, path.join(coverageOutputPath, 'coverage.json')); - writeReport(coverageCollector, 'text', {}, path.join(coverageOutputPath, 'coverage.txt')); + writeReport(coverageCollector, 'text', { dir: '/' }, path.join(coverageOutputPath, 'coverage.txt')); return result; } From e78080ca04216c6fdc183eb2979adbc80f37f78e Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Mon, 17 Apr 2017 01:35:42 +0530 Subject: [PATCH 116/256] Reduce coverage files path length --- src/coverageprocessor.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index 4fd6630acb..dbd4d2fbdf 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -54,9 +54,13 @@ function processResult(result: Result): Result { if (!jestConfig.testResultsProcessor) return result; + if (jestConfig.coverageDirectory && jestConfig.coverageDirectory.startsWith(root)) { + jestConfig.coverageDirectory = '.' + jestConfig.coverageDirectory.substr(root.length); + } + const coverageConfig = { collectCoverage: jestConfig.collectCoverage ? jestConfig.collectCoverage : true, - coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : path.join(root, 'coverage'), + coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : './coverage', coverageReporters: jestConfig.coverageReporters }; @@ -104,7 +108,7 @@ function processResult(result: Result): Result { writeReport(coverageCollector, 'html', {}, path.join(coverageOutputPath, 'html')); writeReport(coverageCollector, 'lcovonly', {}, path.join(coverageOutputPath, 'lcov.info')); writeReport(coverageCollector, 'json', {}, path.join(coverageOutputPath, 'coverage.json')); - writeReport(coverageCollector, 'text', { dir: '/' }, path.join(coverageOutputPath, 'coverage.txt')); + writeReport(coverageCollector, 'text', {}, path.join(coverageOutputPath, 'coverage.txt')); return result; } From 9b793bbf676da66eed3425ea6a1f6bda1f000dfc Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Mon, 17 Apr 2017 01:52:01 +0530 Subject: [PATCH 117/256] Bump version to 19.0.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a95ff27bb..13f00cb8bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.9", + "version": "19.0.10", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 2556e652710a2066a962abc011f891e65f2b6eff Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 24 Apr 2017 13:54:05 -0400 Subject: [PATCH 118/256] Add note about the fix for long paths --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dd84d4090b..88a380d735 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,8 @@ npm install npm test ``` +**Note:** If you are cloning on Windows, you may have to run `git config --system core.longpaths true` for Windows to stop complaining about long filenames. + ## License Copyright (c) [Authors](AUTHORS). From bcc0ea02b25baa14e7225a112b3b68d633a80ac0 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Mon, 24 Apr 2017 20:37:01 +0200 Subject: [PATCH 119/256] use babel for synthetic default imports --- src/preprocessor.ts | 26 +++++++++++++++++++------- src/utils.ts | 11 ++++++++--- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 994f6b09b5..dd1122682d 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -4,8 +4,9 @@ import { getTSConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); +const babelJest = require('babel-jest'); -export function process(src, path, config) { +export function process(src, path, config, transformOptions) { const root = require('jest-util').getPackageRoot(); const compilerOptions = getTSConfig(config.globals, config.collectCoverage); @@ -22,12 +23,22 @@ export function process(src, path, config) { : isTsFile; if (processFile) { - const transpiled = tsc.transpileModule( + const tsTranspiled = tsc.transpileModule( src, { compilerOptions: compilerOptions, fileName: path - }); + } + ); + + const outputText = compilerOptions.allowSyntheticDefaultImports + ? babelJest.process( + tsTranspiled.outputText, + path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ + config, + transformOptions + ) + : tsTranspiled.outputText; // strip root part from path // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter @@ -37,16 +48,17 @@ export function process(src, path, config) { //store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { - fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', new Buffer(path).toString('base64')), transpiled.outputText); + fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', new Buffer(path).toString('base64')), outputText); } - const start = transpiled.outputText.length > 12 ? transpiled.outputText.substr(1, 10) : ''; + const start = outputText.length > 12 ? outputText.substr(1, 10) : ''; const modified = start === 'use strict' - ? `'use strict';require('ts-jest').install();${transpiled.outputText}` - : `require('ts-jest').install();${transpiled.outputText}`; + ? `'use strict';require('ts-jest').install();${outputText}` + : `require('ts-jest').install();${outputText}`; return modified; + } return src; diff --git a/src/utils.ts b/src/utils.ts index cd97232e0a..88863a5277 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -82,13 +82,13 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { if (configFileName === '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 + // 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 // the global __TS_CONFIG__ setting in Jest config config.module = 'commonjs'; } } - + config.module = config.module || 'commonjs'; if (config.inlineSourceMap !== false) { @@ -107,5 +107,10 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config.inlineSources = true; } + if (config.allowSyntheticDefaultImports) { + // compile ts to es2015 and transform with babel afterwards + config.module = 'es2015'; + config.target = 'es2015'; + } return tsc.convertCompilerOptionsFromJson(config, undefined).options; } From 3f5bb658b0413ea6ea80ce5b7b8d1e3496917ae8 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 25 Apr 2017 00:29:32 +0530 Subject: [PATCH 120/256] Update AUTHORS Add @maxdeviant to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index ee06adbd62..8ec87a9ef4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Henry Zektser Ihor Chulinda Joscha Feth Kulshekhar Kabra +Marshall Bowers Maxim Samoilov OJ Kwon Tom Crockett From f00df50afac2ad55de21ecafaafb9c8ec4565309 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 24 Apr 2017 16:37:06 -0400 Subject: [PATCH 121/256] Update @maxdeviant's email address --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 8ec87a9ef4..16522ca42f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,7 +16,7 @@ Henry Zektser Ihor Chulinda Joscha Feth Kulshekhar Kabra -Marshall Bowers +Marshall Bowers Maxim Samoilov OJ Kwon Tom Crockett From 26f524c92796855f5fede4b169cf00dda45bc78f Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Tue, 25 Apr 2017 00:13:21 +0200 Subject: [PATCH 122/256] configure babel transformer for es2015 module transpilation --- package.json | 5 +++-- src/preprocessor.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 13f00cb8bf..60d43c0c4e 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ ] }, "dependencies": { + "babel-preset-es2015": "^6.24.1", "fs-extra": "^2.1.2", "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", @@ -70,8 +71,8 @@ "yargs": "^7.0.2" }, "peerDependencies": { - "typescript": "^2.1.0", - "jest": "^19.0.0" + "jest": "^19.0.0", + "typescript": "^2.1.0" }, "devDependencies": { "@types/es6-shim": "latest", diff --git a/src/preprocessor.ts b/src/preprocessor.ts index dd1122682d..348c73e2e0 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -4,7 +4,7 @@ import { getTSConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); -const babelJest = require('babel-jest'); +const babelJest = require('babel-jest').createTransformer({presets: ['es2015']}); export function process(src, path, config, transformOptions) { const root = require('jest-util').getPackageRoot(); From fe8c1a9ed6d0fd689eccc4737abf0818fea8fda6 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Tue, 25 Apr 2017 00:14:13 +0200 Subject: [PATCH 123/256] add tests for synthetic default import handling --- .../synthetic-default-imports.spec.ts | 28 +++++++++++++++++++ .../__tests__/module.test.ts | 8 ++++++ tests/no-synthetic-default/module.js | 3 ++ tests/no-synthetic-default/package.json | 14 ++++++++++ tests/no-synthetic-default/tsconfig.json | 6 ++++ .../__tests__/module.test.ts | 9 ++++++ tests/synthetic-default/module.js | 3 ++ tests/synthetic-default/package.json | 17 +++++++++++ tests/synthetic-default/tsconfig.json | 6 ++++ 9 files changed, 94 insertions(+) create mode 100644 tests/__tests__/synthetic-default-imports.spec.ts create mode 100644 tests/no-synthetic-default/__tests__/module.test.ts create mode 100644 tests/no-synthetic-default/module.js create mode 100644 tests/no-synthetic-default/package.json create mode 100644 tests/no-synthetic-default/tsconfig.json create mode 100644 tests/synthetic-default/__tests__/module.test.ts create mode 100644 tests/synthetic-default/module.js create mode 100644 tests/synthetic-default/package.json create mode 100644 tests/synthetic-default/tsconfig.json diff --git a/tests/__tests__/synthetic-default-imports.spec.ts b/tests/__tests__/synthetic-default-imports.spec.ts new file mode 100644 index 0000000000..cf168228b4 --- /dev/null +++ b/tests/__tests__/synthetic-default-imports.spec.ts @@ -0,0 +1,28 @@ +import { } from 'jest'; +import { } from 'node'; +import runJest from '../__helpers__/runJest'; + +describe('synthetic default imports', () => { + + it('should not work when the compiler option is false', () => { + + const result = runJest('../no-synthetic-default', ['--no-cache']); + + const stderr = result.stderr.toString(); + + expect(result.status).toBe(1); + expect(stderr).toContain(`TypeError: Cannot read property 'someExport' of undefined`); + expect(stderr).toContain('module.test.ts:6:15'); + + }); + + it('should work when the compiler option is true', () => { + + const result = runJest('../synthetic-default', ['--no-cache']); + + expect(result.status).toBe(0); + + }); + + +}); diff --git a/tests/no-synthetic-default/__tests__/module.test.ts b/tests/no-synthetic-default/__tests__/module.test.ts new file mode 100644 index 0000000000..1e1356f216 --- /dev/null +++ b/tests/no-synthetic-default/__tests__/module.test.ts @@ -0,0 +1,8 @@ +import mod from '../module'; +import 'jest'; + +describe('the module which has no default export', () => { + it('should return funky junk when trying to access its exports', () => { + expect(mod.someExport).toBe('someExport'); + }); +}); diff --git a/tests/no-synthetic-default/module.js b/tests/no-synthetic-default/module.js new file mode 100644 index 0000000000..2ff9520dd0 --- /dev/null +++ b/tests/no-synthetic-default/module.js @@ -0,0 +1,3 @@ +module.exports = { + someExport: 'someExport' +} diff --git a/tests/no-synthetic-default/package.json b/tests/no-synthetic-default/package.json new file mode 100644 index 0000000000..c2f99eac77 --- /dev/null +++ b/tests/no-synthetic-default/package.json @@ -0,0 +1,14 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "moduleDirectories": ["node_modules", "src"], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/no-synthetic-default/tsconfig.json b/tests/no-synthetic-default/tsconfig.json new file mode 100644 index 0000000000..595e0b034e --- /dev/null +++ b/tests/no-synthetic-default/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": false + } +} diff --git a/tests/synthetic-default/__tests__/module.test.ts b/tests/synthetic-default/__tests__/module.test.ts new file mode 100644 index 0000000000..1094d5fbf1 --- /dev/null +++ b/tests/synthetic-default/__tests__/module.test.ts @@ -0,0 +1,9 @@ +import mod from '../module'; +import 'jest'; + + +describe('the module which has no default export', () => { + it('should return sensible values when trying to access its exports', () => { + expect(mod.someExport).toBe('someExport'); + }); +}); diff --git a/tests/synthetic-default/module.js b/tests/synthetic-default/module.js new file mode 100644 index 0000000000..2ff9520dd0 --- /dev/null +++ b/tests/synthetic-default/module.js @@ -0,0 +1,3 @@ +module.exports = { + someExport: 'someExport' +} diff --git a/tests/synthetic-default/package.json b/tests/synthetic-default/package.json new file mode 100644 index 0000000000..e7468a7f19 --- /dev/null +++ b/tests/synthetic-default/package.json @@ -0,0 +1,17 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "moduleDirectories": [ + "node_modules", + "src" + ], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/synthetic-default/tsconfig.json b/tests/synthetic-default/tsconfig.json new file mode 100644 index 0000000000..abd78f479f --- /dev/null +++ b/tests/synthetic-default/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": true + } +} From 0c92a278435e575be645c701408a31444457cb75 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 25 Apr 2017 12:32:22 +0530 Subject: [PATCH 124/256] Bump version to 19.0.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60d43c0c4e..ff31794707 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.10", + "version": "19.0.11", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 447379043506836ff4b3d2a0d6c4e0f0ad27f4a3 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Tue, 25 Apr 2017 10:37:54 -0400 Subject: [PATCH 125/256] Adds completed jest setup for react native --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 88a380d735..33ce0e3a42 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,26 @@ In `package.json`, inside `jest` section, the `transform` should be like this: } ``` +Fully completed jest section should look like this: + +```json +"jest": { + "preset": "react-native", + "transform": { + "^.+\\.js$": "/node_modules/babel-jest", + ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +``` +If only testing typescript files then remove the `js` option in the testRegex. + + ## Options By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. From 62166513e637146c7b878ca1cc2199627f6a2829 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Wed, 26 Apr 2017 17:03:56 +0100 Subject: [PATCH 126/256] add failing test --- tests/synthetic-default/__tests__/module.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/synthetic-default/__tests__/module.test.ts b/tests/synthetic-default/__tests__/module.test.ts index 1094d5fbf1..5856b0b3b4 100644 --- a/tests/synthetic-default/__tests__/module.test.ts +++ b/tests/synthetic-default/__tests__/module.test.ts @@ -7,3 +7,16 @@ describe('the module which has no default export', () => { expect(mod.someExport).toBe('someExport'); }); }); + +async function noop() { + return Promise.resolve('noop'); +} + +describe('async-await stuff', () => { + it('should be compiled by TS not Babel', async (done) => { + const g = await noop(); + + expect(g).toBe('noop'); + done(); + }); +}); From a66a0ee432925382aeff525833c0cf194e535302 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Wed, 26 Apr 2017 17:04:29 +0100 Subject: [PATCH 127/256] babel transform only module statements --- package.json | 3 ++- src/preprocessor.ts | 6 +++++- src/utils.ts | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ff31794707..a3a477c868 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ ] }, "dependencies": { - "babel-preset-es2015": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "fs-extra": "^2.1.2", "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", @@ -71,6 +71,7 @@ "yargs": "^7.0.2" }, "peerDependencies": { + "babel-jest": "^19.0.0", "jest": "^19.0.0", "typescript": "^2.1.0" }, diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 348c73e2e0..f1d5bab723 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -4,7 +4,11 @@ import { getTSConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); -const babelJest = require('babel-jest').createTransformer({presets: ['es2015']}); +const babelJest = require('babel-jest') + .createTransformer({ + presets: [], + plugins: ['transform-es2015-modules-commonjs'] + }); export function process(src, path, config, transformOptions) { const root = require('jest-util').getPackageRoot(); diff --git a/src/utils.ts b/src/utils.ts index 88863a5277..ce7befb2b2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -110,7 +110,6 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { if (config.allowSyntheticDefaultImports) { // compile ts to es2015 and transform with babel afterwards config.module = 'es2015'; - config.target = 'es2015'; } return tsc.convertCompilerOptionsFromJson(config, undefined).options; } From e06e4b7ec76efc24ca24647af187d3f86acd914d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 26 Apr 2017 22:05:15 +0530 Subject: [PATCH 128/256] Bump version to 19.0.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3a477c868..a467fd2cb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.11", + "version": "19.0.12", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 2b3209a5184d1b75c0a9c2ae86964943ea2a63d0 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Wed, 26 Apr 2017 17:53:19 +0100 Subject: [PATCH 129/256] make babel jest normal dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a467fd2cb8..184933518f 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ ] }, "dependencies": { + "babel-jest": "^19.0.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "fs-extra": "^2.1.2", "glob-all": "^3.1.0", @@ -71,7 +72,6 @@ "yargs": "^7.0.2" }, "peerDependencies": { - "babel-jest": "^19.0.0", "jest": "^19.0.0", "typescript": "^2.1.0" }, From 31eb161ac0e50c3096be1b2d2507d3121190e2e9 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Wed, 26 Apr 2017 18:07:29 +0100 Subject: [PATCH 130/256] bump version, add self to authors --- AUTHORS | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 16522ca42f..69b4bebdb3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,7 @@ Bartosz Gościński Blake Embrey Chong Guo Daniel Perez Alvarez +David Sheldrick Emil Persson Eric Anderson Felipe Matos diff --git a/package.json b/package.json index 184933518f..50583fffc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.12", + "version": "19.0.13", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 31e3a98385f46ff76a7d48f1266e68cb501999a9 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 27 Apr 2017 00:27:55 +0530 Subject: [PATCH 131/256] Update AUTHORS close #178 --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69b4bebdb3..2df272e76f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,6 +17,7 @@ Henry Zektser Ihor Chulinda Joscha Feth Kulshekhar Kabra +Kyle Roach Marshall Bowers Maxim Samoilov OJ Kwon From 7f869ae5616fee086ddf29b11ce6efd175b80217 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 28 Apr 2017 01:41:36 +0530 Subject: [PATCH 132/256] Update coverage related tests with new values --- tests/__tests__/long-path.spec.ts | 6 +++--- tests/__tests__/ts-coverage-async.spec.ts | 6 +++--- tests/__tests__/ts-coverage.spec.ts | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts index 5e8627b668..b85281dc61 100644 --- a/tests/__tests__/long-path.spec.ts +++ b/tests/__tests__/long-path.spec.ts @@ -7,11 +7,11 @@ describe('Long (but not too long) path', () => { `-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| - simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long${path.sep} | 57.14 | 0 | 66.67 | 50 | | + simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long${path.sep} | 50 | 0 | 66.67 | 42.86 | | Hello.ts | 100 | 100 | 100 | 100 | | - NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | + NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -All files | 57.14 | 0 | 66.67 | 50 | | +All files | 50 | 0 | 66.67 | 42.86 | | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| `; diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index d7ae4e71c5..963522e194 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -7,11 +7,11 @@ describe('hello_world', () => { `------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------------|----------|----------|----------|----------|----------------| - simple-async${path.sep} | 71.43 | 33.33 | 66.67 | 66.67 | | + simple-async${path.sep} | 66.67 | 33.33 | 66.67 | 61.54 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | - NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | + NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | ------------------|----------|----------|----------|----------|----------------| -All files | 71.43 | 33.33 | 66.67 | 66.67 | | +All files | 66.67 | 33.33 | 66.67 | 61.54 | | ------------------|----------|----------|----------|----------|----------------| `; diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 31559f0291..d370d5ed96 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -7,11 +7,11 @@ describe('hello_world', () => { `------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------------|----------|----------|----------|----------|----------------| - simple${path.sep} | 71.43 | 33.33 | 66.67 | 66.67 | | + simple${path.sep} | 66.67 | 33.33 | 66.67 | 61.54 | | Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | - NullCoverage.js | 0 | 0 | 0 | 0 | 2,3,5 | + NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | ------------------|----------|----------|----------|----------|----------------| -All files | 71.43 | 33.33 | 66.67 | 66.67 | | +All files | 66.67 | 33.33 | 66.67 | 61.54 | | ------------------|----------|----------|----------|----------|----------------| `; From d12b9fe6dc4279acfc41d04f627211afcf26475e Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 28 Apr 2017 01:45:49 +0530 Subject: [PATCH 133/256] Bump version to 19.0.14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50583fffc7..054bae14e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.13", + "version": "19.0.14", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 906be123b3c97eb0c542e57bf068d88d32290517 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 27 Apr 2017 22:46:07 +0000 Subject: [PATCH 134/256] fix(package): update fs-extra to version 3.0.0 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 054bae14e3..2ffc74f9cc 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "dependencies": { "babel-jest": "^19.0.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "fs-extra": "^2.1.2", + "fs-extra": "^3.0.0", "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", "jest-config": "^19.0.0", From acfe27e85674ed582ba16ce3e16f2bf940700ad0 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 1 May 2017 21:07:04 +0000 Subject: [PATCH 135/256] chore(package): update @types/fs-extra to version 3.0.0 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ffc74f9cc..0dfb064d1a 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ }, "devDependencies": { "@types/es6-shim": "latest", - "@types/fs-extra": "^2.0.0", + "@types/fs-extra": "^3.0.0", "@types/jest": "latest", "@types/lodash.assign": "latest", "@types/lodash.includes": "latest", From 0b2ea982bd2689b9a2a0ca37e0d1f396d9047e64 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 3 May 2017 14:57:53 +0000 Subject: [PATCH 136/256] fix(package): update yargs to version 8.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0dfb064d1a..b28357dca9 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "remap-istanbul": "^0.9.5", "source-map-support": "^0.4.4", "tsconfig": "^6.0.0", - "yargs": "^7.0.2" + "yargs": "^8.0.1" }, "peerDependencies": { "jest": "^19.0.0", From 78f45dfae018d738366ef193414f4b6681affa06 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:02:49 +0530 Subject: [PATCH 137/256] Update Jest. Add new dependency --- package.json | 13 +- yarn.lock | 3311 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3318 insertions(+), 6 deletions(-) create mode 100644 yarn.lock diff --git a/package.json b/package.json index b28357dca9..0bdbadd86c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "19.0.14", + "version": "20.0.0", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", @@ -55,24 +55,25 @@ ] }, "dependencies": { - "babel-jest": "^19.0.0", + "babel-jest": "^20.0.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "fs-extra": "^3.0.0", "glob-all": "^3.1.0", "istanbul-lib-instrument": "^1.2.0", - "jest-config": "^19.0.0", - "jest-util": "^19.0.0", + "jest-config": "^20.0.0", + "jest-util": "^20.0.0", "lodash.assign": "^4.2.0", "lodash.includes": "^4.3.0", "lodash.partition": "^4.6.0", "lodash.pickby": "^4.6.0", + "pkg-dir": "^2.0.0", "remap-istanbul": "^0.9.5", "source-map-support": "^0.4.4", "tsconfig": "^6.0.0", "yargs": "^8.0.1" }, "peerDependencies": { - "jest": "^19.0.0", + "jest": "^20.0.0", "typescript": "^2.1.0" }, "devDependencies": { @@ -89,7 +90,7 @@ "cross-spawn": "latest", "cross-spawn-with-kill": "latest", "doctoc": "latest", - "jest": "^19.0.0", + "jest": "^20.0.0", "react": "latest", "react-test-renderer": "latest", "rimraf": "latest", diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000000..68f69deb6c --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3311 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/es6-shim@latest": + version "0.31.33" + resolved "https://registry.yarnpkg.com/@types/es6-shim/-/es6-shim-0.31.33.tgz#4792bdecc8c7f09a7e086968cfbb8058e459379d" + +"@types/fs-extra@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.0.tgz#13e5566e4d780618ba52bd55e0dc713d7a687e59" + dependencies: + "@types/node" "*" + +"@types/jest@latest": + version "19.2.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-19.2.3.tgz#61748040e8589a891dfc2ec1d16a2dd74482980e" + +"@types/lodash.assign@latest": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@types/lodash.assign/-/lodash.assign-4.2.2.tgz#f9d2d3db1c86a86e9183c79df99a4655ac94d9c9" + dependencies: + "@types/lodash" "*" + +"@types/lodash.includes@latest": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@types/lodash.includes/-/lodash.includes-4.3.2.tgz#49a20928d8303b26aa2d31fd9d89c8c6f2daab23" + dependencies: + "@types/lodash" "*" + +"@types/lodash.partition@latest": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@types/lodash.partition/-/lodash.partition-4.6.2.tgz#aac98d79767badab4d31f12bd7c35709a9323e5d" + dependencies: + "@types/lodash" "*" + +"@types/lodash.pickby@latest": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@types/lodash.pickby/-/lodash.pickby-4.6.2.tgz#4bc769c90dc308ecc0c1fae7453def340d660dd9" + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.64" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.64.tgz#979cf3a3d4a368670840bf9b3e448dc33ffe84ee" + +"@types/node@*", "@types/node@latest": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + +"@types/react@latest": + version "15.0.24" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.24.tgz#8a75299dc37906df327c18ca918bf97a55e7123b" + +"@types/source-map-support@latest": + version "0.2.28" + resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.2.28.tgz#ce6497dfa9c9fbd21a753955b4a51d8993d759dd" + dependencies: + "@types/node" "*" + +abab@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" + +abbrev@1, abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + +acorn@^4.0.4: + version "4.0.11" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4, amdefine@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +anchor-markdown-header@^0.5.5: + version "0.5.7" + resolved "https://registry.yarnpkg.com/anchor-markdown-header/-/anchor-markdown-header-0.5.7.tgz#045063d76e6a1f9cd327a57a0126aa0fdec371a7" + dependencies: + emoji-regex "~6.1.0" + +ansi-escapes@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + dependencies: + color-convert "^1.0.0" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + +array-differ@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-uniq@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asap@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +async@1.x, async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + dependencies: + lodash "^4.14.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.20.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-core@^6.0.0, babel-core@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.24.1" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + +babel-generator@^6.18.0, babel-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^19.0.0" + +babel-jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.0.tgz#05ae371102ee8e30c9d61ffdf3f61c738a87741f" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^20.0.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.0.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.1" + test-exclude "^4.1.0" + +babel-plugin-jest-hoist@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" + +babel-plugin-jest-hoist@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.0.tgz#d2afe94fa6aea3b8bfa5d61d8028f633c898d86d" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +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-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" + dependencies: + babel-plugin-jest-hoist "^19.0.0" + +babel-preset-jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.0.tgz#16b992c9351c2525e87a19fd36ba14e47df51bad" + dependencies: + babel-plugin-jest-hoist "^20.0.0" + +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" + dependencies: + babel-core "^6.24.1" + babel-runtime "^6.22.0" + core-js "^2.4.0" + home-or-tmp "^2.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" + +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.16.0, babel-template@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.18.0, babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babylon "^6.15.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.18.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: + version "6.17.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + +bail@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.1.tgz#912579de8b391aadf3c5fdf4cd2a0fc225df3bc2" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +beeper@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +boundary@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/boundary/-/boundary-1.0.1.tgz#4d67dc2602c0cc16dd9bce7ebf87e948290f5812" + +brace-expansion@^1.0.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-resolve@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +ccount@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.1.tgz#665687945168c218ec77ff61a4155ae00227a96c" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +character-entities-html4@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.0.tgz#1ab08551d3ce1fa1df08d00fb9ca1defb147a06c" + +character-entities-legacy@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz#b18aad98f6b7bcc646c1e4c81f9f1956376a561a" + +character-entities@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.0.tgz#a683e2cf75dbe8b171963531364e58e18a1b155f" + +character-reference-invalid@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.0.tgz#dec9ad1dfb9f8d06b4fcdaa2adc3c4fd97af1e68" + +ci-info@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone-stats@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + +clone@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collapse-white-space@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.2.tgz#9c463fb9c6d190d2dcae21a356a01bcae9eeef6d" + +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + +colors@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +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.1.0, convert-source-map@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cross-spawn-with-kill@latest: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cross-spawn-with-kill/-/cross-spawn-with-kill-1.0.0.tgz#6d76b7bbfd148eb10bd0322fceb180ea9b0477a8" + dependencies: + cross-spawn "^4.0.0" + ps-tree "^1.1.0" + +cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@latest: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +dateformat@^1.0.11: + version "1.0.12" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" + dependencies: + get-stdin "^4.0.1" + meow "^3.3.0" + +debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.3: + version "2.6.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" + dependencies: + ms "0.7.3" + +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@^3.0.0, diff@^3.0.1, diff@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + +doctoc@latest: + version "1.3.0" + resolved "https://registry.yarnpkg.com/doctoc/-/doctoc-1.3.0.tgz#7f0839851dd58c808a2cae55d9504e012d08ee30" + dependencies: + anchor-markdown-header "^0.5.5" + htmlparser2 "~3.9.2" + markdown-to-ast "~3.4.0" + minimist "~1.2.0" + underscore "~1.8.3" + update-section "^0.3.0" + +dom-serializer@0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + dependencies: + domelementtype "~1.1.1" + entities "~1.1.1" + +domelementtype@1, domelementtype@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + dependencies: + domelementtype "1" + +domutils@^1.5.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.0.tgz#853de07f013287f976b7fe0461740222ea14ecbb" + dependencies: + dom-serializer "0" + domelementtype "1" + +duplexer2@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" + +duplexer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +emoji-regex@~6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.3.tgz#ec79a3969b02d2ecf2b72254279bf99bc7a83932" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +"errno@>=0.1.1 <0.2.0-0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@1.8.x, escodegen@^1.6.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@2.7.x, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-stream@~3.3.0: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" + dependencies: + merge "^1.1.3" + +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@^3.0.0, extend@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +fancy-log@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" + dependencies: + chalk "^1.1.1" + time-stamp "^1.0.0" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +fbjs@^0.8.9: + version "0.8.12" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.9" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +findup-sync@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.3.0.tgz#37930aa5d816b777c03445e1966cc6790a4c0b16" + dependencies: + glob "~5.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + +fs-extra@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + +fs-extra@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^3.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-all@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab" + dependencies: + glob "^7.0.5" + yargs "~1.2.6" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^5.0.15, glob@~5.0.0: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.0.0: + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + +glogg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" + dependencies: + sparkles "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +gulp-util@3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" + dependencies: + array-differ "^1.0.0" + array-uniq "^1.0.2" + beeper "^1.0.0" + chalk "^1.0.0" + dateformat "^1.0.11" + fancy-log "^1.1.0" + gulplog "^1.0.0" + has-gulplog "^0.1.0" + lodash._reescape "^3.0.0" + lodash._reevaluate "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.template "^3.0.0" + minimist "^1.1.0" + multipipe "^0.1.2" + object-assign "^3.0.0" + replace-ext "0.0.1" + through2 "^2.0.0" + vinyl "^0.5.0" + +gulplog@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + dependencies: + glogg "^1.0.0" + +handlebars@^4.0.1, handlebars@^4.0.3: + version "4.0.8" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.8.tgz#22b875cd3f0e6cbea30314f144e82bc7a72ff420" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-gulplog@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" + dependencies: + sparkles "^1.0.0" + +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + +html-encoding-sniffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz#79bf7a785ea495fe66165e734153f363ff5437da" + dependencies: + whatwg-encoding "^1.0.1" + +htmlparser2@~3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@0.4.13, iconv-lite@~0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +is-alphabetical@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.0.tgz#e2544c13058255f2144cb757066cd3342a1c8c46" + +is-alphanumerical@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.0.tgz#e06492e719c1bf15dec239e4f1af5f67b4d6e7bf" + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-ci@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-decimal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.0.tgz#940579b6ea63c628080a69e62bda88c8470b4fe0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-hexadecimal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.0.tgz#5c459771d2af9a2e3952781fd54fcb1bcfe4113c" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-api@^1.1.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" + +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.13.0" + istanbul-lib-coverage "^1.1.0" + semver "^5.3.0" + +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" + dependencies: + istanbul-lib-coverage "^1.1.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" + dependencies: + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" + dependencies: + handlebars "^4.0.3" + +istanbul@0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + +jest-changed-files@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.0.tgz#2ad82870a815b40ce3f4bf4555581d387b21022c" + +jest-cli@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.0.tgz#72664e0723bd099a0bade5bd4bf960fd54876069" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.0" + jest-config "^20.0.0" + jest-docblock "^20.0.0" + jest-environment-jsdom "^20.0.0" + jest-haste-map "^20.0.0" + jest-jasmine2 "^20.0.0" + jest-message-util "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve-dependencies "^20.0.0" + jest-runtime "^20.0.0" + jest-snapshot "^20.0.0" + jest-util "^20.0.0" + micromatch "^2.3.11" + node-notifier "^5.0.2" + pify "^2.3.0" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.2.12" + worker-farm "^1.3.1" + yargs "^7.0.2" + +jest-config@^19.0.0: + version "19.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" + dependencies: + chalk "^1.1.1" + jest-environment-jsdom "^19.0.2" + jest-environment-node "^19.0.2" + jest-jasmine2 "^19.0.2" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.2" + jest-validate "^19.0.2" + pretty-format "^19.0.0" + +jest-config@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.0.tgz#295fe937a377f79a8eea240ad29546bf43acbbec" + dependencies: + chalk "^1.1.3" + glob "^7.1.1" + jest-environment-jsdom "^20.0.0" + jest-environment-node "^20.0.0" + jest-jasmine2 "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve "^20.0.0" + jest-validate "^20.0.0" + pretty-format "^20.0.0" + +jest-diff@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" + dependencies: + chalk "^1.1.3" + diff "^3.0.0" + jest-matcher-utils "^19.0.0" + pretty-format "^19.0.0" + +jest-diff@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.0.tgz#d6e9190b57e0333c6706ef28d62b1cb23042d7eb" + dependencies: + chalk "^1.1.3" + diff "^3.2.0" + jest-matcher-utils "^20.0.0" + pretty-format "^20.0.0" + +jest-docblock@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.0.tgz#5b647c4af36f52dae74df1949a8cb418d146ad3a" + +jest-environment-jsdom@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + jsdom "^9.11.0" + +jest-environment-jsdom@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.0.tgz#a688499d817e33cdea6400c502d8d5f4aa01c808" + dependencies: + jest-mock "^20.0.0" + jest-util "^20.0.0" + jsdom "^9.12.0" + +jest-environment-node@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + +jest-environment-node@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.0.tgz#7016d8d1270cbc1ed71a10f242c78324297e1db8" + dependencies: + jest-mock "^20.0.0" + jest-util "^20.0.0" + +jest-file-exists@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" + +jest-haste-map@^19.0.0: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.6" + micromatch "^2.3.11" + sane "~1.5.0" + worker-farm "^1.3.1" + +jest-haste-map@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.0.tgz#3b8d9255dfe2a6a96e516fe71dafd415e1b5d65f" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^20.0.0" + micromatch "^2.3.11" + sane "~1.6.0" + worker-farm "^1.3.1" + +jest-jasmine2@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" + dependencies: + graceful-fs "^4.1.6" + jest-matcher-utils "^19.0.0" + jest-matchers "^19.0.0" + jest-message-util "^19.0.0" + jest-snapshot "^19.0.2" + +jest-jasmine2@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.0.tgz#2a0aba92ed36ec132901cfc2a552fd7cee6fde3d" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-matchers "^20.0.0" + jest-message-util "^20.0.0" + jest-snapshot "^20.0.0" + once "^1.4.0" + p-map "^1.1.1" + +jest-matcher-utils@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" + dependencies: + chalk "^1.1.3" + pretty-format "^19.0.0" + +jest-matcher-utils@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.0.tgz#2c5d9dd11670c5418ffc78baecf9094db9e91e09" + dependencies: + chalk "^1.1.3" + pretty-format "^20.0.0" + +jest-matchers@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" + dependencies: + jest-diff "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + +jest-matchers@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.0.tgz#55498637bbb58f164d97c73610fb8d016dfac770" + dependencies: + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-message-util "^20.0.0" + jest-regex-util "^20.0.0" + +jest-message-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" + dependencies: + chalk "^1.1.1" + micromatch "^2.3.11" + +jest-message-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.0.tgz#060bac1980bd5e11134e8e1c19c94863d937c727" + dependencies: + chalk "^1.1.3" + micromatch "^2.3.11" + slash "^1.0.0" + +jest-mock@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" + +jest-mock@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.0.tgz#3c54b94fe502ed57f2e602fab22ab196a7aa4b95" + +jest-regex-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" + +jest-regex-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.0.tgz#7f6051e9d00fdcccca52bade50aabdd9919bcfd2" + +jest-resolve-dependencies@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.0.tgz#616c6976c52e49d13e6420b1bcc8f380e701408f" + dependencies: + jest-regex-util "^20.0.0" + +jest-resolve@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" + dependencies: + browser-resolve "^1.11.2" + jest-haste-map "^19.0.0" + resolve "^1.2.0" + +jest-resolve@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.0.tgz#f9bfdfa31109aee2decfc3a07c2c354608cc5e1d" + dependencies: + browser-resolve "^1.11.2" + is-builtin-module "^1.0.0" + resolve "^1.3.2" + +jest-runtime@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.0.tgz#4c78c08573ffaeba9b8ceb096f705b75d5fb54a1" + dependencies: + babel-core "^6.0.0" + babel-jest "^20.0.0" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.0" + jest-haste-map "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve "^20.0.0" + jest-util "^20.0.0" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^7.0.2" + +jest-snapshot@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" + dependencies: + chalk "^1.1.3" + jest-diff "^19.0.0" + jest-file-exists "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-util "^19.0.2" + natural-compare "^1.4.0" + pretty-format "^19.0.0" + +jest-snapshot@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.0.tgz#fbe51d94ed1c6cd23808bb7ef82e58ca12a0ccf7" + dependencies: + chalk "^1.1.3" + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-util "^20.0.0" + natural-compare "^1.4.0" + pretty-format "^20.0.0" + +jest-util@^19.0.0, jest-util@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" + dependencies: + chalk "^1.1.1" + graceful-fs "^4.1.6" + jest-file-exists "^19.0.0" + jest-message-util "^19.0.0" + jest-mock "^19.0.0" + jest-validate "^19.0.2" + leven "^2.0.0" + mkdirp "^0.5.1" + +jest-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.0.tgz#5421322f196e884e962bc8b8bac4b009733caed9" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.0" + jest-mock "^20.0.0" + jest-validate "^20.0.0" + leven "^2.1.0" + mkdirp "^0.5.1" + +jest-validate@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + +jest-validate@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.0.tgz#c0832e8210190b6d5b39a46b8df536083131a7d7" + dependencies: + chalk "^1.1.3" + jest-matcher-utils "^20.0.0" + leven "^2.1.0" + pretty-format "^20.0.0" + +jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.0.tgz#58cf6abf328f2a2e3c4203890131cbe89d3b0769" + dependencies: + jest-cli "^20.0.0" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-yaml@3.x, js-yaml@^3.7.0: + version "3.8.3" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom@^9.11.0, jsdom@^9.12.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +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.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +leven@^2.0.0, leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basetostring@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" + +lodash._basevalues@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash._reescape@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" + +lodash._reevaluate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" + +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + +lodash._root@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + +lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + +lodash.escape@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" + dependencies: + lodash._root "^3.0.0" + +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.partition@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.partition/-/lodash.partition-4.6.0.tgz#a38e46b73469e0420b0da1212e66d414be364ba4" + +lodash.pickby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" + +lodash.restparam@^3.0.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" + +lodash.template@^3.0.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" + dependencies: + lodash._basecopy "^3.0.0" + lodash._basetostring "^3.0.0" + lodash._basevalues "^3.0.0" + lodash._isiterateecall "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + lodash.keys "^3.0.0" + lodash.restparam "^3.0.0" + lodash.templatesettings "^3.0.0" + +lodash.templatesettings@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + +lodash@^4.14.0, lodash@^4.2.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +longest-streak@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-1.0.0.tgz#d06597c4d4c31b52ccb1f5d8f8fe7148eafd6965" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0, loose-envify@^1.1.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + +markdown-table@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-0.4.0.tgz#890c2c1b3bfe83fb00e4129b8e4cfe645270f9d1" + +markdown-to-ast@~3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/markdown-to-ast/-/markdown-to-ast-3.4.0.tgz#0e2cba81390b0549a9153ec3b0d915b61c164be7" + dependencies: + debug "^2.1.3" + remark "^5.0.1" + structured-source "^3.0.2" + traverse "^0.6.6" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +meow@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" + +minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.x, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +ms@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + +multipipe@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" + dependencies: + duplexer2 "0.0.2" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +node-fetch@^1.0.1: + version "1.6.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.0.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" + dependencies: + growly "^1.3.0" + semver "^5.3.0" + shellwords "^0.1.0" + which "^1.2.12" + +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.3.9" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@1.x, once@^1.3.0, once@^1.3.3, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@^0.6.1, optimist@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-locale@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" + dependencies: + execa "^0.5.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + +parse-entities@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.0.tgz#4bc58f35fdc8e65dded35a12f2e40223ca24a3f7" + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + has "^1.0.1" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + dependencies: + through "~2.3" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-format@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" + dependencies: + ansi-styles "^3.0.0" + +pretty-format@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.0.tgz#bd100f330e707e4f49fef3f234d6e915242a6e7e" + dependencies: + ansi-styles "^3.0.0" + +private@^0.1.6: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +promise@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" + dependencies: + asap "~2.0.3" + +prop-types@^15.5.7: + version "15.5.8" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + dependencies: + fbjs "^0.8.9" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +ps-tree@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" + dependencies: + event-stream "~3.3.0" + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +randomatic@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +react-test-renderer@latest: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-15.5.4.tgz#d4ebb23f613d685ea8f5390109c2d20fbf7c83bc" + dependencies: + fbjs "^0.8.9" + object-assign "^4.1.0" + +react@latest: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.7" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +readable-stream@^2.0.2, readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +remap-istanbul@^0.9.5: + version "0.9.5" + resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.9.5.tgz#a18617b1f31eec5a7dbee77538298b775606aaa8" + dependencies: + amdefine "^1.0.0" + gulp-util "3.0.7" + istanbul "0.4.5" + minimatch "^3.0.3" + source-map ">=0.5.6" + through2 "2.0.1" + +remark-parse@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-1.1.0.tgz#c3ca10f9a8da04615c28f09aa4e304510526ec21" + dependencies: + collapse-white-space "^1.0.0" + extend "^3.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^1.0.0" + vfile-location "^2.0.0" + +remark-stringify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-1.1.0.tgz#a7105e25b9ee2bf9a49b75d2c423f11b06ae2092" + dependencies: + ccount "^1.0.0" + extend "^3.0.0" + longest-streak "^1.0.0" + markdown-table "^0.4.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + stringify-entities "^1.0.1" + unherit "^1.0.4" + +remark@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-5.1.0.tgz#cb463bd3dbcb4b99794935eee1cf71d7a8e3068c" + dependencies: + remark-parse "^1.1.0" + remark-stringify "^1.1.0" + unified "^4.1.1" + +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2, repeat-string@^1.5.4: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +replace-ext@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + +request@^2.79.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve@1.1.7, resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.6.1, rimraf@latest: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + +sane@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sax@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shellwords@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +source-map-support@^0.4.2, source-map-support@^0.4.4: + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" + dependencies: + source-map "^0.5.6" + +source-map@>=0.5.6, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + +sparkles@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + dependencies: + through "2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + dependencies: + duplexer "~0.1.1" + +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +stringify-entities@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.0.tgz#2244a516c4f1e8e01b73dad01023016776abd917" + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + has "^1.0.1" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +structured-source@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/structured-source/-/structured-source-3.0.2.tgz#dd802425e0f53dc4a6e7aca3752901a1ccda7af5" + dependencies: + boundary "^1.0.1" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.0, supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +throat@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" + +through2@2.0.1, through2@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9" + dependencies: + readable-stream "~2.0.0" + xtend "~4.0.0" + +through@2, through@~2.3, through@~2.3.1: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +time-stamp@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-fast-properties@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tough-cookie@^2.3.2, tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + +traverse@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +trim-trailing-lines@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684" + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + +trough@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" + +ts-jest@latest: + version "19.0.14" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-19.0.14.tgz#88674b956e048f61b0ab28d421bfdabbb641be5c" + dependencies: + babel-jest "^19.0.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + fs-extra "^2.1.2" + glob-all "^3.1.0" + istanbul-lib-instrument "^1.2.0" + jest-config "^19.0.0" + jest-util "^19.0.0" + lodash.assign "^4.2.0" + lodash.includes "^4.3.0" + lodash.partition "^4.6.0" + lodash.pickby "^4.6.0" + remap-istanbul "^0.9.5" + source-map-support "^0.4.4" + tsconfig "^6.0.0" + yargs "^7.0.2" + +tsconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" + dependencies: + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tslint@next: + version "5.0.0-dev.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.0.0-dev.0.tgz#d7fc5dfd5304b17fd7f97ad5755852ba8607f6e9" + dependencies: + babel-code-frame "^6.20.0" + colors "^1.1.2" + diff "^3.0.1" + findup-sync "~0.3.0" + glob "^7.1.1" + optimist "~0.6.0" + resolve "^1.1.7" + tsutils "^1.1.0" + +tsutils@^1.1.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.8.0.tgz#bf8118ed8e80cd5c9fc7d75728c7963d44ed2f52" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typescript@latest: + version "2.3.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" + +ua-parser-js@^0.7.9: + version "0.7.12" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" + +uglify-js@^2.6: + version "2.8.22" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +underscore@~1.8.3: + version "1.8.3" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" + +unherit@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.0.tgz#6b9aaedfbf73df1756ad9e316dd981885840cd7d" + dependencies: + inherits "^2.0.1" + xtend "^4.0.1" + +unified@^4.1.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/unified/-/unified-4.2.1.tgz#76ff43aa8da430f6e7e4a55c84ebac2ad2cfcd2e" + dependencies: + bail "^1.0.0" + extend "^3.0.0" + has "^1.0.1" + once "^1.3.3" + trough "^1.0.0" + vfile "^1.0.0" + +unist-util-remove-position@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.0.tgz#2444fedc344bc5f540dab6353e013b6d78101dc2" + dependencies: + unist-util-visit "^1.1.0" + +unist-util-visit@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.1.tgz#e917a3b137658b335cb4420c7da2e74d928e4e94" + +universalify@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" + +update-section@^0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/update-section/-/update-section-0.3.3.tgz#458f17820d37820dc60e20b86d94391b00123158" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +vfile-location@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.1.tgz#0bf8816f732b0f8bd902a56fda4c62c8e935dc52" + +vfile@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-1.4.0.tgz#c0fd6fa484f8debdb771f68c31ed75d88da97fe7" + +vinyl@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + +whatwg-encoding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" + dependencies: + iconv-lite "0.4.13" + +whatwg-fetch@>=0.10.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + +whatwg-url@^4.3.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.1.1, which@^1.2.12, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@^1.0.0, wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +worker-farm@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" + dependencies: + errno ">=0.1.1 <0.2.0-0" + xtend ">=4.0.0 <4.1.0-0" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1, xtend@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + dependencies: + camelcase "^4.1.0" + +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa" + dependencies: + camelcase "^4.1.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + read-pkg-up "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^7.0.0" + +yargs@~1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b" + dependencies: + minimist "^0.1.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From bd52569badecd993b9b0dcc991082db401b963cc Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:03:38 +0530 Subject: [PATCH 138/256] Use pkg-dir to get root directory --- src/coverageprocessor.ts | 4 ++-- src/preprocessor.ts | 20 ++++++++++---------- tests/__tests__/jestconfig-json.spec.ts | 13 ++++++------- tests/__tests__/jestconfig-package.spec.ts | 13 ++++++------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts index dbd4d2fbdf..773ffdf4bb 100644 --- a/src/coverageprocessor.ts +++ b/src/coverageprocessor.ts @@ -31,8 +31,8 @@ interface Result { } function processResult(result: Result): Result { - const root = require('jest-util').getPackageRoot(); - const jestConfig = getJestConfig(root).config; + const root = require('pkg-dir').sync(); + const jestConfig = getJestConfig(root).options; let sourceCache = {}; let coveredFiles = []; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index f1d5bab723..0bd61a9c80 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -5,13 +5,13 @@ import { getTSConfig } from './utils'; const glob = require('glob-all'); const nodepath = require('path'); const babelJest = require('babel-jest') - .createTransformer({ - presets: [], - plugins: ['transform-es2015-modules-commonjs'] - }); + .createTransformer({ + presets: [], + plugins: ['transform-es2015-modules-commonjs'] + }); export function process(src, path, config, transformOptions) { - const root = require('jest-util').getPackageRoot(); + const root = require('pkg-dir').sync(); const compilerOptions = getTSConfig(config.globals, config.collectCoverage); const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); @@ -37,11 +37,11 @@ export function process(src, path, config, transformOptions) { const outputText = compilerOptions.allowSyntheticDefaultImports ? babelJest.process( - tsTranspiled.outputText, - path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ - config, - transformOptions - ) + tsTranspiled.outputText, + path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ + config, + transformOptions + ) : tsTranspiled.outputText; // strip root part from path diff --git a/tests/__tests__/jestconfig-json.spec.ts b/tests/__tests__/jestconfig-json.spec.ts index 23235f9b88..f51ae48b79 100644 --- a/tests/__tests__/jestconfig-json.spec.ts +++ b/tests/__tests__/jestconfig-json.spec.ts @@ -1,6 +1,5 @@ -const getPackageRoot = require('jest-util').getPackageRoot; - describe('get json jest config', () => { + const pkgDir = require('pkg-dir'); let yargsMock; let getJestConfig; @@ -20,10 +19,10 @@ describe('get json jest config', () => { } }); - const jestConfig = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(pkgDir.sync()); const { collectCoverage } = jestConfig; - const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; + const { coverageReporters, coverageDirectory, collectCoverageFrom } = jestConfig.options; expect(collectCoverage).toBeUndefined(); expect(coverageReporters).toEqual(['html', 'json', 'text']); @@ -41,14 +40,14 @@ describe('get json jest config', () => { } }); - const jestConfig = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(pkgDir.sync()); const { collectCoverage } = jestConfig; - const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; + const { coverageReporters, coverageDirectory, collectCoverageFrom } = jestConfig.options; expect(collectCoverage).toBeTruthy(); expect(coverageReporters).toEqual(['html', 'json', 'text']); expect(coverageDirectory).toContain('test_coverage_dir'); expect(collectCoverageFrom).toEqual(['src/**/*.tsx', 'src/**/*.ts']); }); -}); \ No newline at end of file +}); diff --git a/tests/__tests__/jestconfig-package.spec.ts b/tests/__tests__/jestconfig-package.spec.ts index 3a3547bf39..bade97091d 100644 --- a/tests/__tests__/jestconfig-package.spec.ts +++ b/tests/__tests__/jestconfig-package.spec.ts @@ -1,6 +1,5 @@ -const getPackageRoot = require('jest-util').getPackageRoot; - describe('get package json config', () => { + const pkgDir = require('pkg-dir'); let yargsMock; let getJestConfig; @@ -19,10 +18,10 @@ describe('get package json config', () => { } }); - const jestConfig = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(pkgDir.sync()); const { collectCoverage } = jestConfig; - const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; + const { coverageReporters, coverageDirectory, collectCoverageFrom } = jestConfig.options; expect(collectCoverage).toBeUndefined(); expect(coverageReporters).toEqual(['text']); @@ -38,13 +37,13 @@ describe('get package json config', () => { } }); - const jestConfig = getJestConfig(getPackageRoot()); + const jestConfig = getJestConfig(pkgDir.sync()); const { collectCoverage } = jestConfig; - const { coverageReporters, coverageDirectory, collectCoverageFrom} = jestConfig.config; + const { coverageReporters, coverageDirectory, collectCoverageFrom } = jestConfig.options; expect(collectCoverage).toBeTruthy(); expect(coverageReporters).toEqual(['text']); expect(collectCoverageFrom).toEqual(['src/**/*.tsx', 'src/**/*.ts']); }); -}); \ No newline at end of file +}); From 8c31e52ebd2dbb05fbd6c093092021d7f3e4d357 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:26:25 +0530 Subject: [PATCH 139/256] Remove coverage processor --- src/coverageprocessor.ts | 115 --------------------------------------- 1 file changed, 115 deletions(-) delete mode 100644 src/coverageprocessor.ts diff --git a/src/coverageprocessor.ts b/src/coverageprocessor.ts deleted file mode 100644 index 773ffdf4bb..0000000000 --- a/src/coverageprocessor.ts +++ /dev/null @@ -1,115 +0,0 @@ -import * as path from 'path'; -import * as fs from 'fs'; -import includes = require('lodash.includes'); -import partition = require('lodash.partition'); -const loadCoverage = require('remap-istanbul/lib/loadCoverage'); -const remap = require('remap-istanbul/lib/remap'); -const writeReport = require('remap-istanbul/lib/writeReport'); -const istanbulInstrument = require('istanbul-lib-instrument'); -import pickBy = require('lodash.pickby'); -import { getJestConfig } from './utils'; -const glob = require('glob-all'); - -interface CoverageMap { - merge: (data: Object) => void; - getCoverageSummary: () => Object; - data: Object; - addFileCoverage: (fileCoverage: Object) => void; -} - -declare const global: { - __ts_coverage__cache__: { - coverageConfig: any; - sourceCache: any[]; - coverageCollectFiles: any[]; - } -}; - -// full type https://github.com/facebook/jest/blob/master/types/TestResult.js -interface Result { - coverageMap: CoverageMap; -} - -function processResult(result: Result): Result { - const root = require('pkg-dir').sync(); - const jestConfig = getJestConfig(root).options; - let sourceCache = {}; - let coveredFiles = []; - - let basepath = path.join(jestConfig.cacheDirectory, '/ts-jest/'); - if (!fs.existsSync(basepath)) { - fs.mkdirSync(basepath); - } - let cachedFiles = fs.readdirSync(basepath); - cachedFiles.map((p) => { - let filename = new Buffer(p.replace(basepath, ''), 'base64').toString('utf8'); - // add back root part of filename - // the root part was removed in the preprocessor.ts file to get shorter file names - // long file names could be problematic in some OS - // see https://github.com/kulshekhar/ts-jest/issues/158 - filename = root + filename; - coveredFiles.push(filename); - sourceCache[filename] = fs.readFileSync(path.join(basepath, p), 'ascii'); - }); - - if (!jestConfig.testResultsProcessor) return result; - - if (jestConfig.coverageDirectory && jestConfig.coverageDirectory.startsWith(root)) { - jestConfig.coverageDirectory = '.' + jestConfig.coverageDirectory.substr(root.length); - } - - const coverageConfig = { - collectCoverage: jestConfig.collectCoverage ? jestConfig.collectCoverage : true, - coverageDirectory: jestConfig.coverageDirectory ? jestConfig.coverageDirectory : './coverage', - coverageReporters: jestConfig.coverageReporters - }; - - const coverageCollectFiles = - coverageConfig.collectCoverage && - jestConfig.testResultsProcessor && - jestConfig.collectCoverageFrom && - jestConfig.collectCoverageFrom.length ? - glob.sync(jestConfig.collectCoverageFrom).map(x => path.resolve(root, x)) : []; - - if (!coverageConfig.collectCoverage) return result; - - let coverage; - try { - coverage = [pickBy(result.coverageMap.data, (_, fileName) => includes(coveredFiles, fileName))]; - } catch (e) { - return result; - } - - const uncoveredFiles = partition(coverageCollectFiles, x => includes(coveredFiles, x))[1]; - const coverageOutputPath = path.join(coverageConfig.coverageDirectory || 'coverage', 'remapped'); - - // //generate 'empty' coverage against uncovered files. - // //If source is non-ts passed by allowJS, return empty since not able to lookup from cache - const emptyCoverage = uncoveredFiles.map((x: string) => { - let ret = {}; - if (sourceCache[x]) { - let instrumenter = istanbulInstrument.createInstrumenter(); - instrumenter.instrumentSync(sourceCache[x], x); - ret[x] = instrumenter.fileCoverage; - } - return ret; - }); - - const mergedCoverage = loadCoverage(coverage.concat(emptyCoverage), { readJSON: (t) => t ? t : {} }); - const coverageCollector = remap(mergedCoverage, { - readFile: (x) => { - const key = path.normalize(x); - const source = sourceCache[key]; - delete sourceCache[key]; - return source; - } - }); - - writeReport(coverageCollector, 'html', {}, path.join(coverageOutputPath, 'html')); - writeReport(coverageCollector, 'lcovonly', {}, path.join(coverageOutputPath, 'lcov.info')); - writeReport(coverageCollector, 'json', {}, path.join(coverageOutputPath, 'coverage.json')); - writeReport(coverageCollector, 'text', {}, path.join(coverageOutputPath, 'coverage.txt')); - return result; -} - -module.exports = processResult; From 7414f493a81f4841eca7bf3cef485fc1938936ea Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:26:40 +0530 Subject: [PATCH 140/256] Remove references to coverage processor from readme --- README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/README.md b/README.md index 33ce0e3a42..7f998093cc 100644 --- a/README.md +++ b/README.md @@ -52,22 +52,6 @@ Modify your project's `package.json` so that the `jest` section looks something ``` This setup should allow you to write Jest tests in Typescript and be able to locate errors without any additional gymnastics. -By default `jest` does not provide code coverage remapping for transpiled codes, so if you'd like to have code coverage it needs additional coverage remapping. This can be done via writing custom processing script, or configure `testResultsProcessor` to use built-in coverage remapping in `ts-jest`. -```json -{ - "jest": { - "transform": { - ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" - }, - "testResultsProcessor": "/node_modules/ts-jest/coverageprocessor.js" - } -} -``` - -> **Notes:** -> * If you're experiencing remapping failure with source lookup, it may due to pre-created cache from `jest`. It can be manually deleted, or execute with [`--no-cache`](https://facebook.github.io/jest/docs/troubleshooting.html#caching-issues) to not use those. -> * Remapped reports will be copied to `remapped` directory in coverage directory (e.g. `coverage/remapped`). - ### React Native There is a few additional steps if you want to use it with React Native. From 9f5569e485888aa0c7f008c730218d0137a631d0 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:33:23 +0530 Subject: [PATCH 141/256] Remove test for long paths since we're not remapping anymore --- tests/__tests__/long-path.spec.ts | 27 ------------------- .../Hello.ts | 3 --- .../NullCoverage.js | 6 ----- .../__tests__/Hello.test.ts | 7 ----- .../package.json | 21 --------------- .../tsconfig.json | 10 ------- 6 files changed, 74 deletions(-) delete mode 100644 tests/__tests__/long-path.spec.ts delete mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts delete mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js delete mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts delete mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json delete mode 100644 tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json diff --git a/tests/__tests__/long-path.spec.ts b/tests/__tests__/long-path.spec.ts deleted file mode 100644 index b85281dc61..0000000000 --- a/tests/__tests__/long-path.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import runJest from '../__helpers__/runJest'; -import * as fs from 'fs'; -import * as path from 'path'; - -describe('Long (but not too long) path', () => { - const snapshot = - `-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| - simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long${path.sep} | 50 | 0 | 66.67 | 42.86 | | - Hello.ts | 100 | 100 | 100 | 100 | | - NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -All files | 50 | 0 | 66.67 | 42.86 | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|----------|----------------| -`; - - it('should work as expected', () => { - runJest('../simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long', ['--no-cache', '--coverage']); - - const coveragePath = path.resolve('./tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/coverage/remapped/coverage.txt'); - - expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); - }); - -}); diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts deleted file mode 100644 index 9c4322b72b..0000000000 --- a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/Hello.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Hello { - name: string = 'John Doe'; -} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js deleted file mode 100644 index c59dbbdef3..0000000000 --- a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/NullCoverage.js +++ /dev/null @@ -1,6 +0,0 @@ -function nullCoverageFunction(value) { - if (value) { - return value; - } - return null; -} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts deleted file mode 100644 index be56b29b4f..0000000000 --- a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/__tests__/Hello.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Hello } from '../Hello'; - -describe('Hello test in long path', () => { - it('should work', () => { - expect(new Hello().name).toEqual('John Doe'); - }) -}) diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json deleted file mode 100644 index e881f09b1b..0000000000 --- a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "jest": { - "transform": { - ".(ts|tsx)": "../../preprocessor.js" - }, - "testResultsProcessor": "../../coverageprocessor.js", - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "coverageReporters": [ - "json" - ], - "collectCoverageFrom": [ - "Hello.ts", - "NullCoverage.js" - ], - "moduleFileExtensions": [ - "ts", - "tsx", - "js" - ] - } -} diff --git a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json b/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json deleted file mode 100644 index 55f8667f97..0000000000 --- a/tests/simple-long-long-long-long-long--long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "ES5", - "module": "commonjs", - "moduleResolution": "node", - "noEmitOnError": false, - "jsx": "react", - "allowJs": true - } -} From d6e99474882b2c41a2adf4d60d1f83d9beb278a6 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:39:27 +0530 Subject: [PATCH 142/256] Remove tests for remapped coverage --- tests/__tests__/ts-remapped-coverage.spec.ts | 27 ---------------- tests/tsremappedcoverage/a.test.ts | 5 --- tests/tsremappedcoverage/a.ts | 1 - tests/tsremappedcoverage/b.test.ts | 5 --- tests/tsremappedcoverage/b.ts | 1 - tests/tsremappedcoverage/package.json | 33 -------------------- tests/tsremappedcoverage/tsconfig.json | 3 -- 7 files changed, 75 deletions(-) delete mode 100644 tests/__tests__/ts-remapped-coverage.spec.ts delete mode 100644 tests/tsremappedcoverage/a.test.ts delete mode 100644 tests/tsremappedcoverage/a.ts delete mode 100644 tests/tsremappedcoverage/b.test.ts delete mode 100644 tests/tsremappedcoverage/b.ts delete mode 100644 tests/tsremappedcoverage/package.json delete mode 100644 tests/tsremappedcoverage/tsconfig.json diff --git a/tests/__tests__/ts-remapped-coverage.spec.ts b/tests/__tests__/ts-remapped-coverage.spec.ts deleted file mode 100644 index e8ad7e2050..0000000000 --- a/tests/__tests__/ts-remapped-coverage.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import runJest from '../__helpers__/runJest'; -import * as fs from 'fs'; -import * as path from 'path'; - -describe('tsremappedcoverage', () => { - const snapshot = - `---------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ----------------------|----------|----------|----------|----------|----------------| - tsremappedcoverage${path.sep} | 100 | 100 | 100 | 100 | | - a.ts | 100 | 100 | 100 | 100 | | - b.ts | 100 | 100 | 100 | 100 | | ----------------------|----------|----------|----------|----------|----------------| -All files | 100 | 100 | 100 | 100 | | ----------------------|----------|----------|----------|----------|----------------| -`; - - it('should run successfully', () => { - runJest('../tsremappedcoverage', ['--no-cache', '--coverage']); - - const coveragePath = path.resolve('./tests/tsremappedcoverage/coverage/remapped/coverage.txt'); - - expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); - }); - -}); \ No newline at end of file diff --git a/tests/tsremappedcoverage/a.test.ts b/tests/tsremappedcoverage/a.test.ts deleted file mode 100644 index b4e839d5fd..0000000000 --- a/tests/tsremappedcoverage/a.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { a } from './a' - -it('a', () => { - expect(a).toBe(0) -}) diff --git a/tests/tsremappedcoverage/a.ts b/tests/tsremappedcoverage/a.ts deleted file mode 100644 index c4b41a2c0b..0000000000 --- a/tests/tsremappedcoverage/a.ts +++ /dev/null @@ -1 +0,0 @@ -export const a = 0 diff --git a/tests/tsremappedcoverage/b.test.ts b/tests/tsremappedcoverage/b.test.ts deleted file mode 100644 index 97f02513f4..0000000000 --- a/tests/tsremappedcoverage/b.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { b } from './b' - -it('b', () => { - expect(b).toBe(0) -}) diff --git a/tests/tsremappedcoverage/b.ts b/tests/tsremappedcoverage/b.ts deleted file mode 100644 index f108918c6f..0000000000 --- a/tests/tsremappedcoverage/b.ts +++ /dev/null @@ -1 +0,0 @@ -export const b = 0 diff --git a/tests/tsremappedcoverage/package.json b/tests/tsremappedcoverage/package.json deleted file mode 100644 index 807a47349b..0000000000 --- a/tests/tsremappedcoverage/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "scripts": { - "test": "shx rm -rf coverage && jest --coverage --no-cache", - "test:series": "shx rm -rf coverage && jest -i --coverage --no-cache" - }, - "jest": { - "collectCoverageFrom": [ - "**/*.ts" - ], - "moduleFileExtensions": [ - "js", - "ts" - ], - "testRegex": "\\.test\\.ts$", - "testResultsProcessor": "../../coverageprocessor.js", - "transform": { - ".(ts|tsx)": "../../preprocessor.js" - } - }, - "dependencies": { - "@types/jest": "19.2.0", - "jest": "19.0.2", - "jest-cli": "19.0.2", - "shx": "0.2.2", - "ts-jest": "19.0.0", - "typescript": "2.2.1" - }, - "engines": { - "node": "7.7.2", - "npm": "4.3.0" - }, - "private": true -} diff --git a/tests/tsremappedcoverage/tsconfig.json b/tests/tsremappedcoverage/tsconfig.json deleted file mode 100644 index 78a6452265..0000000000 --- a/tests/tsremappedcoverage/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "compileOnSave": false -} From 42a92bbbd8417fe794afbc8501592a06b9f7564b Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:45:57 +0530 Subject: [PATCH 143/256] Remove test for coverage directory --- tests/simple/with-coverage-dir.json | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 tests/simple/with-coverage-dir.json diff --git a/tests/simple/with-coverage-dir.json b/tests/simple/with-coverage-dir.json deleted file mode 100644 index c2fed527e2..0000000000 --- a/tests/simple/with-coverage-dir.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "transform": { - ".(ts|tsx)": "../../preprocessor.js" - }, - "testResultsProcessor": "../../coverageprocessor.js", - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js" - ], - "coverageDirectory": "coverage-custom", - "collectCoverageFrom": [ - "Hello.ts", - "NullCoverage.js" - ], - "coverageReporters": [ - "text" - ] -} From 4448613965aacb02bea05c7a316d90cd4f692a9a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:46:47 +0530 Subject: [PATCH 144/256] Update coverage related tests to use jest for coverage info --- tests/__tests__/ts-coverage-async.spec.ts | 10 ++++---- tests/__tests__/ts-coverage.spec.ts | 29 +++++------------------ tests/simple-async/package.json | 4 ++-- tests/simple/package.json | 4 ++-- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index 963522e194..2a21d06ed0 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -16,12 +16,14 @@ All files | 66.67 | 33.33 | 66.67 | 61.54 | | `; it('should run successfully', () => { - runJest('../simple-async', ['--no-cache', '--coverage']); + const result = runJest('../simple-async', ['--no-cache', '--coverage']); - const coveragePath = path.resolve('./tests/simple-async/coverage/remapped/coverage.txt'); + const output = result.stdout.toString(); - expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); + expect(output).toContain('Statements : 66.67% ( 10/15 )'); + expect(output).toContain('Branches : 33.33% ( 2/6 )'); + expect(output).toContain('Functions : 66.67% ( 4/6 )'); + expect(output).toContain('Lines : 61.54% ( 8/13 )'); }); }); diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index d370d5ed96..825930ebae 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -3,33 +3,16 @@ import * as fs from 'fs'; import * as path from 'path'; describe('hello_world', () => { - const snapshot = - `------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -------------------|----------|----------|----------|----------|----------------| - simple${path.sep} | 66.67 | 33.33 | 66.67 | 61.54 | | - Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | - NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | -------------------|----------|----------|----------|----------|----------------| -All files | 66.67 | 33.33 | 66.67 | 61.54 | | -------------------|----------|----------|----------|----------|----------------| -`; it('should run successfully', () => { - runJest('../simple', ['--no-cache', '--coverage']); + const result = runJest('../simple', ['--no-cache', '--coverage']); - const coveragePath = path.resolve('./tests/simple/coverage/remapped/coverage.txt'); + const output = result.stdout.toString(); - expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); - expect(fs.readFileSync(coveragePath, 'utf-8')).toEqual(snapshot); - }); - - it('should run successfully with a custom coverage directory', () => { - runJest('../simple', ['--no-cache', '--coverage', '--config', '../simple/with-coverage-dir.json']); - - const coveragePath = path.resolve('./tests/simple/coverage-custom/remapped/coverage.txt'); - - expect(fs.statSync(coveragePath).isFile()).toBeTruthy(); + expect(output).toContain('Statements : 66.67% ( 10/15 )'); + expect(output).toContain('Branches : 33.33% ( 2/6 )'); + expect(output).toContain('Functions : 66.67% ( 4/6 )'); + expect(output).toContain('Lines : 61.54% ( 8/13 )'); }); }); diff --git a/tests/simple-async/package.json b/tests/simple-async/package.json index e83dd791e6..91cdc1d17d 100644 --- a/tests/simple-async/package.json +++ b/tests/simple-async/package.json @@ -4,7 +4,6 @@ "transform": { ".(ts|tsx)": "../../preprocessor.js" }, - "testResultsProcessor": "../../coverageprocessor.js", "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", "coverageReporters": [ "json" @@ -13,10 +12,11 @@ "Hello.ts", "NullCoverage.js" ], + "mapCoverage": true, "moduleFileExtensions": [ "ts", "tsx", "js" ] } -} \ No newline at end of file +} diff --git a/tests/simple/package.json b/tests/simple/package.json index 29598f734a..c2d9c1f52b 100644 --- a/tests/simple/package.json +++ b/tests/simple/package.json @@ -3,7 +3,6 @@ "transform": { ".(ts|tsx)": "../../preprocessor.js" }, - "testResultsProcessor": "../../coverageprocessor.js", "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", "coverageReporters": [ "json" @@ -12,10 +11,11 @@ "Hello.ts", "NullCoverage.js" ], + "mapCoverage": true, "moduleFileExtensions": [ "ts", "tsx", "js" ] } -} \ No newline at end of file +} From 4be7a18bf84d8e08d3abba0b6862205ce475d7e2 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:55:20 +0530 Subject: [PATCH 145/256] Update use strict test to only check for line numbers --- tests/__tests__/use-strict.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/__tests__/use-strict.spec.ts b/tests/__tests__/use-strict.spec.ts index 4cfcc0403f..5bebdd8706 100644 --- a/tests/__tests__/use-strict.spec.ts +++ b/tests/__tests__/use-strict.spec.ts @@ -4,13 +4,12 @@ import runJest from '../__helpers__/runJest'; describe('use strict', () => { - it('should show the error locations for "use strict" violations', () => { + fit('should show the error locations for "use strict" violations', () => { const result = runJest('../use-strict', ['--no-cache', '-t', 'Invalid Strict']); const stderr = result.stderr.toString(); - expect(result.status).toBe(1); expect(stderr).toContain('Strict.ts:4:4'); expect(stderr).toContain('Strict.test.ts:9:5'); @@ -24,4 +23,4 @@ describe('use strict', () => { }); -}); \ No newline at end of file +}); From b2f535e396e285563292852405fa1952400e2a2a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 00:59:59 +0530 Subject: [PATCH 146/256] remove 'fit' from a test --- tests/__tests__/use-strict.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__tests__/use-strict.spec.ts b/tests/__tests__/use-strict.spec.ts index 5bebdd8706..3191df24b3 100644 --- a/tests/__tests__/use-strict.spec.ts +++ b/tests/__tests__/use-strict.spec.ts @@ -4,7 +4,7 @@ import runJest from '../__helpers__/runJest'; describe('use strict', () => { - fit('should show the error locations for "use strict" violations', () => { + it('should show the error locations for "use strict" violations', () => { const result = runJest('../use-strict', ['--no-cache', '-t', 'Invalid Strict']); From 1f15b87ab53b8fa6fbf5a08082fcf972e4f78431 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 01:05:23 +0530 Subject: [PATCH 147/256] Remove all remnants of coverageprocessor --- coverageprocessor.js | 1 - tests/__tests__/use-strict.spec.ts | 1 + tests/jestconfig-test/jest.json | 4 ++-- tests/use-strict/package.json | 4 ++-- tests/watch-test/package.json | 8 +++++--- 5 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 coverageprocessor.js diff --git a/coverageprocessor.js b/coverageprocessor.js deleted file mode 100644 index d2f91c87b2..0000000000 --- a/coverageprocessor.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/coverageprocessor'); \ No newline at end of file diff --git a/tests/__tests__/use-strict.spec.ts b/tests/__tests__/use-strict.spec.ts index 3191df24b3..c5966879a0 100644 --- a/tests/__tests__/use-strict.spec.ts +++ b/tests/__tests__/use-strict.spec.ts @@ -10,6 +10,7 @@ describe('use strict', () => { const stderr = result.stderr.toString(); + expect(result.status).toBe(1); expect(stderr).toContain('Strict.ts:4:4'); expect(stderr).toContain('Strict.test.ts:9:5'); diff --git a/tests/jestconfig-test/jest.json b/tests/jestconfig-test/jest.json index 2418d90057..7aef3047c9 100644 --- a/tests/jestconfig-test/jest.json +++ b/tests/jestconfig-test/jest.json @@ -3,7 +3,7 @@ "transform": { ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" }, - "testResultsProcessor": "/node_modules/ts-jest/coverageprocessor.js", + "mapCoverage": true, "testRegex": "/specs/.*\\.spec\\.(ts|tsx|js)$", "testEnvironment": "jsdom", "coverageReporters": [ @@ -27,4 +27,4 @@ "statements": 95 } } -} \ No newline at end of file +} diff --git a/tests/use-strict/package.json b/tests/use-strict/package.json index 5d69a11426..fbc5d42c81 100644 --- a/tests/use-strict/package.json +++ b/tests/use-strict/package.json @@ -3,7 +3,7 @@ "transform": { ".(ts|tsx)": "../../preprocessor.js" }, - "testResultsProcessor": "../../coverageprocessor.js", + "mapCoverage": true, "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", "moduleFileExtensions": [ "ts", @@ -11,4 +11,4 @@ "js" ] } -} \ No newline at end of file +} diff --git a/tests/watch-test/package.json b/tests/watch-test/package.json index f1c98a98c6..60a1e9547e 100644 --- a/tests/watch-test/package.json +++ b/tests/watch-test/package.json @@ -3,13 +3,15 @@ "transform": { ".(ts|tsx)": "../../preprocessor.js" }, - "testResultsProcessor": "../../coverageprocessor.js", + "mapCoverage": true, "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "coverageReporters": ["json"], + "coverageReporters": [ + "json" + ], "moduleFileExtensions": [ "ts", "tsx", "js" ] } -} \ No newline at end of file +} From 0dfc7bf74cd5eb5d4fa5e388e2f86e4f10126719 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 01:10:56 +0530 Subject: [PATCH 148/256] Remove unused dependencies --- package.json | 10 ---------- src/utils.ts | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/package.json b/package.json index 0bdbadd86c..c4e5c31503 100644 --- a/package.json +++ b/package.json @@ -59,15 +59,9 @@ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "fs-extra": "^3.0.0", "glob-all": "^3.1.0", - "istanbul-lib-instrument": "^1.2.0", "jest-config": "^20.0.0", "jest-util": "^20.0.0", - "lodash.assign": "^4.2.0", - "lodash.includes": "^4.3.0", - "lodash.partition": "^4.6.0", - "lodash.pickby": "^4.6.0", "pkg-dir": "^2.0.0", - "remap-istanbul": "^0.9.5", "source-map-support": "^0.4.4", "tsconfig": "^6.0.0", "yargs": "^8.0.1" @@ -80,10 +74,6 @@ "@types/es6-shim": "latest", "@types/fs-extra": "^3.0.0", "@types/jest": "latest", - "@types/lodash.assign": "latest", - "@types/lodash.includes": "latest", - "@types/lodash.partition": "latest", - "@types/lodash.pickby": "latest", "@types/node": "latest", "@types/react": "latest", "@types/source-map-support": "latest", diff --git a/src/utils.ts b/src/utils.ts index ce7befb2b2..7d5a6e2175 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,7 +3,6 @@ import * as path from 'path'; import * as fs from 'fs'; import * as tsconfig from 'tsconfig'; -import assign = require('lodash.assign'); const normalize = require('jest-config').normalize; const setFromArgv = require('jest-config/build/setFromArgv'); @@ -48,7 +47,7 @@ function readRawConfig(argv, root) { } if (typeof rawConfig === 'object') { - const config = assign({}, rawConfig); + const config = Object.assign({}, rawConfig); config.rootDir = config.rootDir || root; return normalize(config, argv); } From cabebde83de1f95715768b59a1ece43a6c92ddf0 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 01:14:59 +0530 Subject: [PATCH 149/256] Add a note on using jest for coverage reports --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 7f998093cc..c089f91b36 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ Modify your project's `package.json` so that the `jest` section looks something ``` This setup should allow you to write Jest tests in Typescript and be able to locate errors without any additional gymnastics. +### Coverage + +Prior to version `20.0.0`, coverage reports could be obtained using the inbuilt coverage processor in `ts-jest`. Starting with version `20.0.0`, `ts-jest` delegates coverage processing to jest and no longer includes a coverage processor. + +To generate coverage results, set the `mapCoverage` property in the `jest` configuration section to `true`. + ### React Native There is a few additional steps if you want to use it with React Native. From 043e9b6397e586a3bf65b11c0eeff9685f0f41b2 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sun, 7 May 2017 01:27:42 +0530 Subject: [PATCH 150/256] Update test to exclude path separator --- tests/__tests__/import.spec.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/__tests__/import.spec.ts b/tests/__tests__/import.spec.ts index ad1793ac1b..b6aaf40d8c 100644 --- a/tests/__tests__/import.spec.ts +++ b/tests/__tests__/import.spec.ts @@ -1,6 +1,6 @@ import { } from 'jest'; import { } from 'node'; -import * as path from 'path'; +import * as path from 'path'; import runJest from '../__helpers__/runJest'; describe('import with relative and absolute paths', () => { @@ -15,16 +15,16 @@ describe('import with relative and absolute paths', () => { expect(result.status).toBe(1); expect(output).toContain('4 failed, 4 total'); - expect(stderr).toContain('at new Hello (src' + path.sep + 'classes' + path.sep + 'Hello.ts:11:11)'); + expect(stderr).toContain('Hello.ts:11:11)'); - expect(stderr).toContain('at Object. (__tests__' + path.sep + 'classes' + path.sep + 'Hello.test.ts:9:19)'); - expect(stderr).toContain('at Object. (__tests__' + path.sep + 'classes' + path.sep + 'Hello-relative.test.ts:9:19)'); + expect(stderr).toContain('Hello.test.ts:9:19)'); + expect(stderr).toContain('Hello-relative.test.ts:9:19)'); - expect(stderr).toContain('at Object.simpleFunction (src' + path.sep + 'absolute-import.ts:4:17)'); - expect(stderr).toContain('at Object. (__tests__' + path.sep + 'absolute-import.test.ts:8:9)'); + expect(stderr).toContain('absolute-import.ts:4:17)'); + expect(stderr).toContain('absolute-import.test.ts:8:9)'); - expect(stderr).toContain('at Object.simpleFunction (src' + path.sep + 'relative-import.ts:4:17)'); - expect(stderr).toContain('at Object. (__tests__' + path.sep + 'relative-import.test.ts:8:9)'); + expect(stderr).toContain('relative-import.ts:4:17)'); + expect(stderr).toContain('relative-import.test.ts:8:9)'); }); -}); \ No newline at end of file +}); From c0769567cf6ab253dbca669069fe5a391c4c332d Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 8 May 2017 17:59:50 +1000 Subject: [PATCH 151/256] fix: remove outDir when collecting coverage --- README.md | 2 ++ package.json | 2 +- src/utils.ts | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c089f91b36..2ed4c4d474 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ Prior to version `20.0.0`, coverage reports could be obtained using the inbuilt To generate coverage results, set the `mapCoverage` property in the `jest` configuration section to `true`. +> Please note that the `outDir` property in the `jest` configuration section is removed in coverage mode, due to [#201](https://github.com/kulshekhar/ts-jest/issues/201). + ### React Native There is a few additional steps if you want to use it with React Native. diff --git a/package.json b/package.json index c4e5c31503..da13484532 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.0", + "version": "20.0.1", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", diff --git a/src/utils.ts b/src/utils.ts index 7d5a6e2175..58dda7935d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -104,6 +104,12 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config.inlineSourceMap = true; config.inlineSources = true; + + if (config.outDir) { + // the coverage report is broken if `.outDir` is set + // see https://github.com/kulshekhar/ts-jest/issues/201 + delete config.outDir; + } } if (config.allowSyntheticDefaultImports) { From cb081288484afbbde4886961d4d2ae9b717167dc Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 8 May 2017 18:17:13 +1000 Subject: [PATCH 152/256] fix: peer dependency against Typescript 2.x --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c4e5c31503..dbf1292963 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ }, "peerDependencies": { "jest": "^20.0.0", - "typescript": "^2.1.0" + "typescript": "2.x" }, "devDependencies": { "@types/es6-shim": "latest", From a504320eacf43d475bff29428b0834dae7b5df4c Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 8 May 2017 23:08:49 +1000 Subject: [PATCH 153/256] refactor: remove if --- src/utils.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 58dda7935d..59fe5cda8f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -98,18 +98,14 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { //inline source with source map for remapping coverage if (collectCoverage) { - if (config.sourceMap) { - delete config.sourceMap; - } + delete config.sourceMap; config.inlineSourceMap = true; config.inlineSources = true; - if (config.outDir) { - // the coverage report is broken if `.outDir` is set - // see https://github.com/kulshekhar/ts-jest/issues/201 - delete config.outDir; - } + // the coverage report is broken if `.outDir` is set + // see https://github.com/kulshekhar/ts-jest/issues/201 + delete config.outDir; } if (config.allowSyntheticDefaultImports) { From 193e756367422a8b55491bc6968828019275695e Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 9 May 2017 12:13:29 +0530 Subject: [PATCH 154/256] Use Jest Config to obtain collectCoverage value --- package.json | 2 +- src/preprocessor.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 81c2e83bca..b8c7fe38e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.1", + "version": "20.0.2", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 0bd61a9c80..358a9c4397 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; -import { getTSConfig } from './utils'; +import { getTSConfig, getJestConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); @@ -12,7 +12,8 @@ const babelJest = require('babel-jest') export function process(src, path, config, transformOptions) { const root = require('pkg-dir').sync(); - const compilerOptions = getTSConfig(config.globals, config.collectCoverage); + const jestConfig = getJestConfig(root); + const compilerOptions = getTSConfig(config.globals, jestConfig.collectCoverage); const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); From 31434654358d931cc5680f83a6e11441782d889c Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 11 May 2017 00:08:56 +0530 Subject: [PATCH 155/256] Use 'instrument' as proxy for 'collectCoverage' --- package.json | 2 +- src/preprocessor.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b8c7fe38e4..6a13c1128e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.2", + "version": "20.0.3", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 358a9c4397..77935413c6 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; -import { getTSConfig, getJestConfig } from './utils'; +import { getTSConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); @@ -12,8 +12,9 @@ const babelJest = require('babel-jest') export function process(src, path, config, transformOptions) { const root = require('pkg-dir').sync(); - const jestConfig = getJestConfig(root); - const compilerOptions = getTSConfig(config.globals, jestConfig.collectCoverage); + // transformOptions.instrument is a proxy for collectCoverage + // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 + const compilerOptions = getTSConfig(config.globals, transformOptions.instrument); const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); From ad3460dc0eff55d543f88f0d1897b94e94dd55d0 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 11 May 2017 00:13:31 +0530 Subject: [PATCH 156/256] Set a default value for transformOptions --- src/preprocessor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 77935413c6..cccc7e7fa0 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -10,7 +10,7 @@ const babelJest = require('babel-jest') plugins: ['transform-es2015-modules-commonjs'] }); -export function process(src, path, config, transformOptions) { +export function process(src, path, config, transformOptions: any = {}) { const root = require('pkg-dir').sync(); // transformOptions.instrument is a proxy for collectCoverage // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 From 51072a026d2a2f5037552c04370c84459221ebe3 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 17 May 2017 16:35:31 +0200 Subject: [PATCH 157/256] updated readme --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ed4c4d474..7e02265b17 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ Ensure `.babelrc` contains: ```json { - "presets": ["react-native"] + "presets": ["react-native"], + "sourceMaps": "inline" } ``` @@ -105,6 +106,18 @@ Fully completed jest section should look like this: ``` If only testing typescript files then remove the `js` option in the testRegex. +You might want to use ES6 default imports, which will allow you to write things like +`import React from 'react';` + +In that case you can add the following to your `.tsconfig` +```json + "allowSyntheticDefaultImports": true +``` + +This will make ts-loader send the compiled typescript code through babel, and the above import will resolve. + +This configuration will allow `debugger` statements to work properly in both WebStorm and VSCode. +Breakpoints currently only work in WebStorm. ## Options By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. From bc8476c9552803c7a4840d60521e6af4843a9a3b Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 18 May 2017 20:00:51 +0530 Subject: [PATCH 158/256] Update AUTHORS add @GeeWee to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2df272e76f..c6812cca38 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ David Sheldrick Emil Persson Eric Anderson Felipe Matos +Gustav Wengel Henry Zektser Ihor Chulinda Joscha Feth From 436ceb961a1dc6a3280be2578968aadae630d10a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 19 May 2017 00:02:07 +0530 Subject: [PATCH 159/256] Add a skipBabel flag --- src/preprocessor.ts | 23 +++++++++++++-------- src/utils.ts | 7 ++++++- tests/__tests__/tsconfig-default.spec.ts | 26 ++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index cccc7e7fa0..dc66c7e4cc 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; -import { getTSConfig } from './utils'; +import { getTSConfig, getTSJestConfig } from './utils'; // TODO: rework next to ES6 style imports const glob = require('glob-all'); const nodepath = require('path'); @@ -9,8 +9,12 @@ const babelJest = require('babel-jest') presets: [], plugins: ['transform-es2015-modules-commonjs'] }); +let tsJestConfig; export function process(src, path, config, transformOptions: any = {}) { + if (tsJestConfig === undefined) { + tsJestConfig = getTSJestConfig(config.globals); + } const root = require('pkg-dir').sync(); // transformOptions.instrument is a proxy for collectCoverage // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 @@ -37,14 +41,15 @@ export function process(src, path, config, transformOptions: any = {}) { } ); - const outputText = compilerOptions.allowSyntheticDefaultImports - ? babelJest.process( - tsTranspiled.outputText, - path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ - config, - transformOptions - ) - : tsTranspiled.outputText; + const outputText = + compilerOptions.allowSyntheticDefaultImports && !tsJestConfig.skipBabel + ? babelJest.process( + tsTranspiled.outputText, + path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ + config, + transformOptions + ) + : tsTranspiled.outputText; // strip root part from path // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter diff --git a/src/utils.ts b/src/utils.ts index 59fe5cda8f..cedd80ba03 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -63,8 +63,13 @@ export function getJestConfig(root) { return Object.freeze(setFromArgv(rawConfig, argv)); } +export function getTSJestConfig(globals) { + return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; +} + export function getTSConfig(globals, collectCoverage: boolean = false) { let config = (globals && globals.__TS_CONFIG__) ? globals.__TS_CONFIG__ : 'tsconfig.json'; + const skipBabel = getTSJestConfig(globals).skipBabel; if (typeof config === 'string') { const configFileName = config; @@ -108,7 +113,7 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { delete config.outDir; } - if (config.allowSyntheticDefaultImports) { + if (config.allowSyntheticDefaultImports && !skipBabel) { // compile ts to es2015 and transform with babel afterwards config.module = 'es2015'; } diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index 5c42c5f80b..91061fa7c6 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -99,4 +99,30 @@ describe('get default ts config', () => { expect(config.module).toBe(ts.ModuleKind.CommonJS); }); + it('should correctly read the ts-jest object within jest settings', () => { + require('path').__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + + const { getTSJestConfig } = require('../../src/utils'); + + const config1 = getTSJestConfig({ + 'ts-jest': { + 'skipBabel': true + }, + }); + + expect(config1.skipBabel).toBe(true); + + const config2 = getTSJestConfig({ + 'ts-jest': { + 'skipBabel': false + }, + }); + + expect(config2.skipBabel).toBe(false); + + expect(getTSJestConfig({ 'ts-jest': {} })).toEqual({}) + expect(getTSJestConfig({})).toEqual({}) + expect(getTSJestConfig()).toEqual({}) + }); + }); From 55ddcb7dafe003cc7c0ecd37c225fed3d8be1213 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 19 May 2017 00:02:22 +0530 Subject: [PATCH 160/256] Bump version to 20.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a13c1128e..786b9f741e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.3", + "version": "20.0.4", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 923ae47cb6229ef339496028608bd037bf917580 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 20 May 2017 19:06:46 +0530 Subject: [PATCH 161/256] Add a note about collaborators --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7e02265b17..b1187e43c9 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![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) +> Note: Looking for collaborators. [Want to help improve ts-jest?](https://github.com/kulshekhar/ts-jest/issues/223) ## Table of Contents From 6ca0cc6980f94b411355f5315964ebf1e606e476 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Sat, 20 May 2017 18:51:16 +0200 Subject: [PATCH 162/256] glob all was not used anymore --- package.json | 1 - src/preprocessor.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/package.json b/package.json index 786b9f741e..8d623ae82b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "babel-jest": "^20.0.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "fs-extra": "^3.0.0", - "glob-all": "^3.1.0", "jest-config": "^20.0.0", "jest-util": "^20.0.0", "pkg-dir": "^2.0.0", diff --git a/src/preprocessor.ts b/src/preprocessor.ts index dc66c7e4cc..d9812f3271 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -2,7 +2,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; // TODO: rework next to ES6 style imports -const glob = require('glob-all'); const nodepath = require('path'); const babelJest = require('babel-jest') .createTransformer({ From ee763c1a38406382d30e7bebca47b583da3ab666 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Sat, 20 May 2017 18:54:10 +0200 Subject: [PATCH 163/256] es6 style imports --- src/preprocessor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index d9812f3271..1390b43ff1 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -2,8 +2,10 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; // TODO: rework next to ES6 style imports -const nodepath = require('path'); -const babelJest = require('babel-jest') +import * as nodepath from 'path'; +import * as babel from 'babel-jest'; + +const babelJest = babel .createTransformer({ presets: [], plugins: ['transform-es2015-modules-commonjs'] From cf2cf36744559e165cf4e5c8e20a3e52f54bfd20 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Sat, 20 May 2017 19:04:23 +0200 Subject: [PATCH 164/256] removed requires and unneeded imports --- tests/__tests__/import.spec.ts | 3 -- .../synthetic-default-imports.spec.ts | 2 -- tests/__tests__/ts-compilation.spec.ts | 2 -- tests/__tests__/ts-coverage-async.spec.ts | 13 ------- tests/__tests__/ts-coverage.spec.ts | 2 -- tests/__tests__/ts-errors.spec.ts | 2 -- tests/__tests__/tsconfig-comments.spec.ts | 8 ++--- tests/__tests__/tsconfig-default.spec.ts | 35 ++++++++----------- tests/__tests__/tsconfig-inline.spec.ts | 9 ++--- tests/__tests__/tsconfig-string.spec.ts | 17 +++++---- tests/__tests__/tsx-compilation.spec.ts | 3 -- tests/__tests__/tsx-errors.spec.ts | 3 -- tests/__tests__/use-strict.spec.ts | 2 -- tests/__tests__/watch.spec.ts | 2 -- 14 files changed, 27 insertions(+), 76 deletions(-) diff --git a/tests/__tests__/import.spec.ts b/tests/__tests__/import.spec.ts index b6aaf40d8c..e48dcfd412 100644 --- a/tests/__tests__/import.spec.ts +++ b/tests/__tests__/import.spec.ts @@ -1,6 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; -import * as path from 'path'; import runJest from '../__helpers__/runJest'; describe('import with relative and absolute paths', () => { diff --git a/tests/__tests__/synthetic-default-imports.spec.ts b/tests/__tests__/synthetic-default-imports.spec.ts index cf168228b4..6fc452917a 100644 --- a/tests/__tests__/synthetic-default-imports.spec.ts +++ b/tests/__tests__/synthetic-default-imports.spec.ts @@ -1,5 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; import runJest from '../__helpers__/runJest'; describe('synthetic default imports', () => { diff --git a/tests/__tests__/ts-compilation.spec.ts b/tests/__tests__/ts-compilation.spec.ts index 23ddf6db38..3e98918783 100644 --- a/tests/__tests__/ts-compilation.spec.ts +++ b/tests/__tests__/ts-compilation.spec.ts @@ -1,5 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; import runJest from '../__helpers__/runJest'; describe('hello_world', () => { diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index 2a21d06ed0..3a13305c7b 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -1,19 +1,6 @@ import runJest from '../__helpers__/runJest'; -import * as fs from 'fs'; -import * as path from 'path'; describe('hello_world', () => { - const snapshot = - `------------------|----------|----------|----------|----------|----------------| -File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | -------------------|----------|----------|----------|----------|----------------| - simple-async${path.sep} | 66.67 | 33.33 | 66.67 | 61.54 | | - Hello.ts | 90.91 | 50 | 80 | 88.89 | 20 | - NullCoverage.js | 0 | 0 | 0 | 0 | 1,2,3,5 | -------------------|----------|----------|----------|----------|----------------| -All files | 66.67 | 33.33 | 66.67 | 61.54 | | -------------------|----------|----------|----------|----------|----------------| -`; it('should run successfully', () => { const result = runJest('../simple-async', ['--no-cache', '--coverage']); diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index 825930ebae..ce501ed548 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -1,6 +1,4 @@ import runJest from '../__helpers__/runJest'; -import * as fs from 'fs'; -import * as path from 'path'; describe('hello_world', () => { diff --git a/tests/__tests__/ts-errors.spec.ts b/tests/__tests__/ts-errors.spec.ts index cba6f6e988..81899f8001 100644 --- a/tests/__tests__/ts-errors.spec.ts +++ b/tests/__tests__/ts-errors.spec.ts @@ -1,5 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; import runJest from '../__helpers__/runJest'; describe('hello_world', () => { diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 9a534675d3..aa6030b60c 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -1,10 +1,8 @@ -import { } from 'jest'; -import { } from 'node'; -import * as ts from 'typescript'; +jest.mock('path'); import * as fs from 'fs'; import * as tsconfig from 'tsconfig'; +import {getTSConfig} from '../../src/utils'; -jest.mock('path'); describe('parse tsconfig with comments', () => { const configFile1 = './tests/tsconfig-test/allows-comments.json'; @@ -42,8 +40,6 @@ describe('parse tsconfig with comments', () => { }); it('should correctly read allow-comments.json', () => { - const { getTSConfig } = require('../../src/utils'); - expect(() => { getTSConfig({ '__TS_CONFIG__': 'allows-comments.json' diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index 91061fa7c6..c745bf5dac 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -1,19 +1,19 @@ -import { } from 'jest'; -import { } from 'node'; -import * as ts from 'typescript' - jest.mock('path'); +import * as ts from 'typescript'; +import {getTSConfig} from '../../src/utils'; +import * as path from 'path'; + + describe('get default ts config', () => { beforeEach(() => { // Set up some mocked out file info before each test - require('path').__setBaseDir('./tests/tsconfig-test'); + (path as any).__setBaseDir('./tests/tsconfig-test'); }); it('should correctly read tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); - const result = getTSConfig(); + const result = getTSConfig(null); expect(result).toEqual({ 'inlineSourceMap': true, @@ -26,8 +26,7 @@ describe('get default ts config', () => { }); it('should not read my-tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); - const result = getTSConfig(); + const result = getTSConfig(null); expect(result).not.toEqual({ 'target': ts.ScriptTarget.ES2015, @@ -39,8 +38,7 @@ describe('get default ts config', () => { }); it('should not read inline tsconfig options', () => { - const { getTSConfig } = require('../../src/utils'); - const result = getTSConfig(); + const result = getTSConfig(null); expect(result).not.toEqual({ 'module': ts.ModuleKind.CommonJS, @@ -49,8 +47,7 @@ describe('get default ts config', () => { }); it('should be same results for null/undefined/etc.', () => { - const { getTSConfig } = require('../../src/utils'); - const result = getTSConfig(); + const result = getTSConfig(null); const resultUndefinedParam = getTSConfig(undefined); const resultNullParam = getTSConfig(null); const resultEmptyParam = getTSConfig({}); @@ -65,7 +62,6 @@ describe('get default ts config', () => { }); it('should not change the module if it is loaded from the Jest config global', () => { - const { getTSConfig } = require('../../src/utils'); const config = getTSConfig({ '__TS_CONFIG__': { 'module': 'es2015' @@ -76,7 +72,6 @@ describe('get default ts config', () => { }); it('should not change the module if it is loaded from a non-default config file', () => { - const { getTSConfig } = require('../../src/utils'); const config = getTSConfig({ '__TS_CONFIG__': 'tsconfig-module/custom-config.json' }); @@ -86,12 +81,10 @@ describe('get default ts config', () => { it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { - // set the base directory such that we can use 'tsconfig.json' as the + // set the base directory such that we can use 'tsconfig.json' as the // config file name instead of 'dir/tsconfig.json' require('path').__setBaseDir('./tests/tsconfig-test/tsconfig-module'); - const { getTSConfig } = require('../../src/utils'); - const config = getTSConfig({ '__TS_CONFIG__': 'tsconfig.json' }); @@ -120,9 +113,9 @@ describe('get default ts config', () => { expect(config2.skipBabel).toBe(false); - expect(getTSJestConfig({ 'ts-jest': {} })).toEqual({}) - expect(getTSJestConfig({})).toEqual({}) - expect(getTSJestConfig()).toEqual({}) + expect(getTSJestConfig({ 'ts-jest': {} })).toEqual({}); + expect(getTSJestConfig({})).toEqual({}); + expect(getTSJestConfig()).toEqual({}); }); }); diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index 62d8791482..95239fdffd 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -1,8 +1,8 @@ -import { } from 'jest'; -import { } from 'node'; +jest.mock('path'); + import * as ts from 'typescript'; +import {getTSConfig} from '../../src/utils'; -jest.mock('path'); describe('get inline ts config', () => { @@ -12,7 +12,6 @@ describe('get inline ts config', () => { }); it('should correctly read inline tsconfig options', () => { - const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', @@ -28,7 +27,6 @@ describe('get inline ts config', () => { }); it('should not read tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', @@ -46,7 +44,6 @@ describe('get inline ts config', () => { }); it('should not read my-tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': { 'module': 'commonjs', diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index 3b1b72f0ab..2ec5dff115 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -1,18 +1,18 @@ -import { } from 'jest'; -import { } from 'node'; +jest.mock('path'); + +import {getTSConfig} from '../../dist/utils'; import * as ts from 'typescript'; +import * as path from 'path'; -jest.mock('path'); describe('get ts config from string', () => { beforeEach(() => { // Set up some mocked out file info before each test - require('path').__setBaseDir('./tests/tsconfig-test'); + (path as any).__setBaseDir('./tests/tsconfig-test'); }); it('should correctly read my-tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); @@ -28,7 +28,7 @@ describe('get ts config from string', () => { }); it('should not read tsconfig.json', () => { - const { getTSConfig } = require('../../src/utils'); + const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); @@ -43,7 +43,7 @@ describe('get ts config from string', () => { }); it('should not read inline tsconfig options', () => { - const { getTSConfig } = require('../../src/utils'); + const result = getTSConfig({ '__TS_CONFIG__': 'my-tsconfig.json' }); @@ -55,7 +55,7 @@ describe('get ts config from string', () => { }); it('should correctly resolve the "extends" directive', () => { - const { getTSConfig } = require('../../src/utils'); + const result = getTSConfig({ '__TS_CONFIG__': 'extends-tsconfig.json' }); @@ -71,7 +71,6 @@ describe('get ts config from string', () => { }); it('should correctly override any config in the "extends" directive', () => { - const { getTSConfig } = require('../../src/utils'); const result = getTSConfig({ '__TS_CONFIG__': 'extends-with-overrides-tsconfig.json' }); diff --git a/tests/__tests__/tsx-compilation.spec.ts b/tests/__tests__/tsx-compilation.spec.ts index da67c4b2a3..62e38e7628 100644 --- a/tests/__tests__/tsx-compilation.spec.ts +++ b/tests/__tests__/tsx-compilation.spec.ts @@ -1,6 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; - import runJest from '../__helpers__/runJest'; describe('button', () => { diff --git a/tests/__tests__/tsx-errors.spec.ts b/tests/__tests__/tsx-errors.spec.ts index 92a50537b7..cb410f7b1f 100644 --- a/tests/__tests__/tsx-errors.spec.ts +++ b/tests/__tests__/tsx-errors.spec.ts @@ -1,6 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; - import runJest from '../__helpers__/runJest'; describe('button', () => { diff --git a/tests/__tests__/use-strict.spec.ts b/tests/__tests__/use-strict.spec.ts index c5966879a0..26fe41f26d 100644 --- a/tests/__tests__/use-strict.spec.ts +++ b/tests/__tests__/use-strict.spec.ts @@ -1,5 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; import runJest from '../__helpers__/runJest'; describe('use strict', () => { diff --git a/tests/__tests__/watch.spec.ts b/tests/__tests__/watch.spec.ts index b6d4ada4da..411b2ec71b 100644 --- a/tests/__tests__/watch.spec.ts +++ b/tests/__tests__/watch.spec.ts @@ -1,5 +1,3 @@ -import { } from 'jest'; -import { } from 'node'; import { ChildProcess } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; From 71fd3c408f02adf0d27f20509a8b625c5c029e62 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Sat, 20 May 2017 19:06:27 +0200 Subject: [PATCH 165/256] removed comment --- src/preprocessor.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 1390b43ff1..e2c22d0f7a 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,7 +1,6 @@ import * as fs from 'fs-extra'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; -// TODO: rework next to ES6 style imports import * as nodepath from 'path'; import * as babel from 'babel-jest'; From 1bdf482c0efeb6163094b23fe151a5232e00e115 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 24 May 2017 22:32:25 +0530 Subject: [PATCH 166/256] Implement getCacheKey to invalidate jest cache when tsconfig changes --- src/jest-types.ts | 52 +++++++++++++++++++++++++++++++++++++++++++++ src/preprocessor.ts | 25 +++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 src/jest-types.ts diff --git a/src/jest-types.ts b/src/jest-types.ts new file mode 100644 index 0000000000..1ccd89e2ce --- /dev/null +++ b/src/jest-types.ts @@ -0,0 +1,52 @@ +export type TransformOptions = { + instrument: boolean; +}; + +export type Path = string; + +export type Glob = string; + +export type ConfigGlobals = { [key: string]: any }; + +export type HasteConfig = { + defaultPlatform?: string | null; + hasteImplModulePath?: string; + platforms?: Array; + providesModuleNodeModules: Array; +}; + +export type JestConfig = { + automock: boolean; + browser: boolean; + cache: boolean; + cacheDirectory: Path; + clearMocks: boolean; + coveragePathIgnorePatterns: Array; + globals: ConfigGlobals; + haste: HasteConfig; + moduleDirectories: Array; + moduleFileExtensions: Array; + moduleLoader: Path; + moduleNameMapper: Array<[string, string]>; + modulePathIgnorePatterns: Array; + modulePaths: Array; + name: string; + resetMocks: boolean; + resetModules: boolean; + resolver: Path | null; + rootDir: Path; + roots: Array; + setupFiles: Array; + setupTestFrameworkScriptFile: Path; + snapshotSerializers: Array; + testEnvironment: string; + testMatch: Array; + testPathIgnorePatterns: Array; + testRegex: string; + testRunner: string; + testURL: string; + timers: 'real' | 'fake'; + transform: Array<[string, Path]>; + transformIgnorePatterns: Array; + unmockedModulePathPatterns: Array | null; +}; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index e2c22d0f7a..afa52c378c 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,8 +1,10 @@ import * as fs from 'fs-extra'; +import * as crypto from 'crypto'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; import * as babel from 'babel-jest'; +import { TransformOptions, Path, JestConfig } from "./jest-types"; const babelJest = babel .createTransformer({ @@ -11,7 +13,12 @@ const babelJest = babel }); let tsJestConfig; -export function process(src, path, config, transformOptions: any = {}) { +export function process( + src: string, + path: string, + config: JestConfig, + transformOptions: TransformOptions) { + if (tsJestConfig === undefined) { tsJestConfig = getTSJestConfig(config.globals); } @@ -74,3 +81,19 @@ export function process(src, path, config, transformOptions: any = {}) { return src; } + +export function getCacheKey( + fileData: string, + filePath: Path, + configStr: string, + options: TransformOptions): string { + + const jestConfig: JestConfig = JSON.parse(configStr); + const tsConfig = getTSConfig(jestConfig.globals, options.instrument); + + return crypto.createHash('md5') + .update(JSON.stringify(tsConfig), 'utf8') + .update(fileData + filePath + configStr, 'utf8') + .update(fs.readFileSync(filePath)) + .digest('hex'); +} From 4c0fbf2d87729019039b18f1fa8da3e2f1c8d0ed Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 24 May 2017 22:34:51 +0530 Subject: [PATCH 167/256] Set default value for transformOptions --- src/preprocessor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index afa52c378c..76d394665a 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -17,7 +17,7 @@ export function process( src: string, path: string, config: JestConfig, - transformOptions: TransformOptions) { + transformOptions: TransformOptions = { instrument: false }) { if (tsJestConfig === undefined) { tsJestConfig = getTSJestConfig(config.globals); @@ -86,7 +86,7 @@ export function getCacheKey( fileData: string, filePath: Path, configStr: string, - options: TransformOptions): string { + options: TransformOptions = { instrument: false }): string { const jestConfig: JestConfig = JSON.parse(configStr); const tsConfig = getTSConfig(jestConfig.globals, options.instrument); From c92e7a1d925fb824e8d4d0a2a1ffeb0ee343214f Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Wed, 24 May 2017 22:45:50 +0530 Subject: [PATCH 168/256] Remove unnecessary step from the hashing process --- src/preprocessor.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 76d394665a..bc3dd58747 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -94,6 +94,5 @@ export function getCacheKey( return crypto.createHash('md5') .update(JSON.stringify(tsConfig), 'utf8') .update(fileData + filePath + configStr, 'utf8') - .update(fs.readFileSync(filePath)) .digest('hex'); } From 9b9d68668248430dbaf13cb476035448ed6ac59a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 25 May 2017 18:05:43 +0530 Subject: [PATCH 169/256] Standardize the type of 'path' --- src/preprocessor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index bc3dd58747..3f392823fd 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -15,7 +15,7 @@ let tsJestConfig; export function process( src: string, - path: string, + path: Path, config: JestConfig, transformOptions: TransformOptions = { instrument: false }) { From 759f0f0e6f0b5260b6c97a512444f50d39c3b57f Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 25 May 2017 18:23:04 +0530 Subject: [PATCH 170/256] Add tests for getCacheKey --- tests/__tests__/get-cache-key.spec.ts | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/__tests__/get-cache-key.spec.ts diff --git a/tests/__tests__/get-cache-key.spec.ts b/tests/__tests__/get-cache-key.spec.ts new file mode 100644 index 0000000000..8b93d0c76c --- /dev/null +++ b/tests/__tests__/get-cache-key.spec.ts @@ -0,0 +1,40 @@ +import { getCacheKey } from "../../src/preprocessor"; + +describe('getCacheKey', () => { + const src = 'console.log(123);'; + const filepath = '/tmp/filepath'; + const configStr = `{ + "globals": { + "__TS_CONFIG": { + "compilerOptions": { + "target": "ES5", + "module": "commonjs" + } + } + }, + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$" + }`; + const originalHash = getCacheKey(src, filepath, configStr); + + it('should change hash when src changes', () => { + const newSrc = 'console.log(1234);' + const newHash = getCacheKey(newSrc, filepath, configStr); + expect(newHash).not.toBe(originalHash); + }); + + it('should change hash when filepath changes', () => { + const newPath = '/tmp/newfilepath' + const newHash = getCacheKey(src, newPath, configStr); + expect(newHash).not.toBe(originalHash); + }); + + it('should change hash when tsconfig changes', () => { + const newConfigStr = configStr.replace(`"ES5"`, `"ES2015"`); + const newHash = getCacheKey(src, filepath, newConfigStr); + expect(newHash).not.toBe(originalHash); + }); + +}); From b2a5afd266447bb59343150e37213df2937d2b86 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Mon, 29 May 2017 14:46:48 +0200 Subject: [PATCH 171/256] first import of babel. Added json to resolve --- .editorconfig | 3 + package.json | 6 +- src/jest-types.ts | 11 ++- src/postprocess.ts | 104 ++++++++++++++++++++++++++ src/preprocessor.ts | 5 +- tests/__tests__/get-cache-key.spec.ts | 6 +- yarn.lock | 68 +++++++---------- 7 files changed, 152 insertions(+), 51 deletions(-) create mode 100644 .editorconfig create mode 100644 src/postprocess.ts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..9541a249ba --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.js] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/package.json b/package.json index 8d623ae82b..9e3298ef52 100644 --- a/package.json +++ b/package.json @@ -51,12 +51,16 @@ ], "moduleFileExtensions": [ "ts", - "js" + "js", + "json" ] }, "dependencies": { + "babel-core": "^6.24.1", "babel-jest": "^20.0.0", + "babel-plugin-istanbul": "^4.1.4", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-preset-jest": "^20.0.3", "fs-extra": "^3.0.0", "jest-config": "^20.0.0", "jest-util": "^20.0.0", diff --git a/src/jest-types.ts b/src/jest-types.ts index 1ccd89e2ce..e1e2980930 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -15,7 +15,16 @@ export type HasteConfig = { providesModuleNodeModules: Array; }; -export type JestConfig = { +export interface PostProcessorOptions { + plugins? : any[]; + presets?: any[]; + cacheDirectory? : string; + filename?: string; +} + +export type JestConfig = Partial; + +export type FullJestConfig = { automock: boolean; browser: boolean; cache: boolean; diff --git a/src/postprocess.ts b/src/postprocess.ts new file mode 100644 index 0000000000..77e4277f3c --- /dev/null +++ b/src/postprocess.ts @@ -0,0 +1,104 @@ +/** + * Postprocess step. Stolen from babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js + */ + +import * as crypto from 'crypto'; +import * as fs from 'fs'; +import * as path from 'path'; +import * as jestPreset from 'babel-preset-jest'; +import { JestConfig, PostProcessorOptions, TransformOptions } from './jest-types'; +import * as babel from 'babel-core'; + +const BABELRC_FILENAME = '.babelrc'; +const BABELRC_JS_FILENAME = '.babelrc.js'; +const BABEL_CONFIG_KEY = 'babel'; +const PACKAGE_JSON = 'package.json'; +//const THIS_FILE = fs.readFileSync(__filename); + +let babel; + +export const createTransformer = (options: PostProcessorOptions) => { + /*const getBabelRC = filename => { + const paths = []; + let directory = filename; + while (directory !== (directory = path.dirname(directory))) { + if (cache[directory]) { + break; + } + + paths.push(directory); + const configFilePath = path.join(directory, BABELRC_FILENAME); + if (fs.existsSync(configFilePath)) { + cache[directory] = fs.readFileSync(configFilePath, 'utf8'); + break; + } + const configJsFilePath = path.join(directory, BABELRC_JS_FILENAME); + if (fs.existsSync(configJsFilePath)) { + // $FlowFixMe + cache[directory] = JSON.stringify(require(configJsFilePath)); + break; + } + const packageJsonFilePath = path.join(directory, PACKAGE_JSON); + if (fs.existsSync(packageJsonFilePath)) { + // $FlowFixMe + const packageJsonFileContents = require(packageJsonFilePath); + if (packageJsonFileContents[BABEL_CONFIG_KEY]) { + cache[directory] = JSON.stringify( + packageJsonFileContents[BABEL_CONFIG_KEY], + ); + break; + } + } + } + paths.forEach(directoryPath => (cache[directoryPath] = cache[directory])); + return cache[directory] || ''; + };*/ + options = Object.assign({}, options, { + plugins: (options && options.plugins) || [], + presets: ((options && options.presets) || []).concat([jestPreset]), + retainLines: true, + }); + delete options.cacheDirectory; + delete options.filename; + return { + canInstrument: true, + /*getCacheKey(fileData: string, + filename: Path, + configString: string, + {instrument}: TransformOptions,): string { + return crypto + .createHash('md5') + .update(THIS_FILE) + .update('\0', 'utf8') + .update(fileData) + .update('\0', 'utf8') + .update(configString) + .update('\0', 'utf8') + .update(getBabelRC(filename)) + .update('\0', 'utf8') + .update(instrument ? 'instrument' : '') + .digest('hex'); + },*/ + process(src: string, + filename : string, + config : JestConfig, + transformOptions : TransformOptions): string { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; + }, + }; +}; \ No newline at end of file diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 3f392823fd..497fbbcbfc 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -3,11 +3,10 @@ import * as crypto from 'crypto'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; -import * as babel from 'babel-jest'; import { TransformOptions, Path, JestConfig } from "./jest-types"; +import { createTransformer } from './postprocess'; -const babelJest = babel - .createTransformer({ +const babelJest = createTransformer({ presets: [], plugins: ['transform-es2015-modules-commonjs'] }); diff --git a/tests/__tests__/get-cache-key.spec.ts b/tests/__tests__/get-cache-key.spec.ts index 8b93d0c76c..4ea411a067 100644 --- a/tests/__tests__/get-cache-key.spec.ts +++ b/tests/__tests__/get-cache-key.spec.ts @@ -1,4 +1,4 @@ -import { getCacheKey } from "../../src/preprocessor"; +import { getCacheKey } from '../../src/preprocessor'; describe('getCacheKey', () => { const src = 'console.log(123);'; @@ -20,13 +20,13 @@ describe('getCacheKey', () => { const originalHash = getCacheKey(src, filepath, configStr); it('should change hash when src changes', () => { - const newSrc = 'console.log(1234);' + const newSrc = 'console.log(1234);'; const newHash = getCacheKey(newSrc, filepath, configStr); expect(newHash).not.toBe(originalHash); }); it('should change hash when filepath changes', () => { - const newPath = '/tmp/newfilepath' + const newPath = '/tmp/newfilepath'; const newHash = getCacheKey(src, newPath, configStr); expect(newHash).not.toBe(originalHash); }); diff --git a/yarn.lock b/yarn.lock index 68f69deb6c..86c3569115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,34 +16,6 @@ version "19.2.3" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-19.2.3.tgz#61748040e8589a891dfc2ec1d16a2dd74482980e" -"@types/lodash.assign@latest": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@types/lodash.assign/-/lodash.assign-4.2.2.tgz#f9d2d3db1c86a86e9183c79df99a4655ac94d9c9" - dependencies: - "@types/lodash" "*" - -"@types/lodash.includes@latest": - version "4.3.2" - resolved "https://registry.yarnpkg.com/@types/lodash.includes/-/lodash.includes-4.3.2.tgz#49a20928d8303b26aa2d31fd9d89c8c6f2daab23" - dependencies: - "@types/lodash" "*" - -"@types/lodash.partition@latest": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@types/lodash.partition/-/lodash.partition-4.6.2.tgz#aac98d79767badab4d31f12bd7c35709a9323e5d" - dependencies: - "@types/lodash" "*" - -"@types/lodash.pickby@latest": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@types/lodash.pickby/-/lodash.pickby-4.6.2.tgz#4bc769c90dc308ecc0c1fae7453def340d660dd9" - dependencies: - "@types/lodash" "*" - -"@types/lodash@*": - version "4.14.64" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.64.tgz#979cf3a3d4a368670840bf9b3e448dc33ffe84ee" - "@types/node@*", "@types/node@latest": version "7.0.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" @@ -284,13 +256,13 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^4.0.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" +babel-plugin-istanbul@^4.0.0, babel-plugin-istanbul@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.4.tgz#18dde84bf3ce329fddf3f4103fae921456d8e587" dependencies: find-up "^2.1.0" - istanbul-lib-instrument "^1.7.1" - test-exclude "^4.1.0" + istanbul-lib-instrument "^1.7.2" + test-exclude "^4.1.1" babel-plugin-jest-hoist@^19.0.0: version "19.0.0" @@ -300,6 +272,10 @@ babel-plugin-jest-hoist@^20.0.0: version "20.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.0.tgz#d2afe94fa6aea3b8bfa5d61d8028f633c898d86d" +babel-plugin-jest-hoist@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" + babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" @@ -328,6 +304,12 @@ babel-preset-jest@^20.0.0: dependencies: babel-plugin-jest-hoist "^20.0.0" +babel-preset-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" + dependencies: + babel-plugin-jest-hoist "^20.0.3" + babel-register@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" @@ -1366,9 +1348,9 @@ istanbul-api@^1.1.1: mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0, istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" istanbul-lib-hook@^1.0.6: version "1.0.6" @@ -1376,16 +1358,16 @@ istanbul-lib-hook@^1.0.6: dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" +istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1, istanbul-lib-instrument@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" semver "^5.3.0" istanbul-lib-report@^1.1.0: @@ -2919,9 +2901,9 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -test-exclude@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" dependencies: arrify "^1.0.1" micromatch "^2.3.11" From 36df4bea6cb8f6ac5f0016aa2ddd6d16765ad5ac Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Mon, 29 May 2017 14:53:09 +0200 Subject: [PATCH 172/256] cleanup of cruft --- src/postprocess.ts | 67 ++------------------------------------------- src/preprocessor.ts | 7 +++-- 2 files changed, 6 insertions(+), 68 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index 77e4277f3c..5e290bb7f0 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -1,84 +1,21 @@ /** * Postprocess step. Stolen from babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js */ - -import * as crypto from 'crypto'; -import * as fs from 'fs'; -import * as path from 'path'; import * as jestPreset from 'babel-preset-jest'; import { JestConfig, PostProcessorOptions, TransformOptions } from './jest-types'; import * as babel from 'babel-core'; -const BABELRC_FILENAME = '.babelrc'; -const BABELRC_JS_FILENAME = '.babelrc.js'; -const BABEL_CONFIG_KEY = 'babel'; -const PACKAGE_JSON = 'package.json'; -//const THIS_FILE = fs.readFileSync(__filename); - -let babel; export const createTransformer = (options: PostProcessorOptions) => { - /*const getBabelRC = filename => { - const paths = []; - let directory = filename; - while (directory !== (directory = path.dirname(directory))) { - if (cache[directory]) { - break; - } - - paths.push(directory); - const configFilePath = path.join(directory, BABELRC_FILENAME); - if (fs.existsSync(configFilePath)) { - cache[directory] = fs.readFileSync(configFilePath, 'utf8'); - break; - } - const configJsFilePath = path.join(directory, BABELRC_JS_FILENAME); - if (fs.existsSync(configJsFilePath)) { - // $FlowFixMe - cache[directory] = JSON.stringify(require(configJsFilePath)); - break; - } - const packageJsonFilePath = path.join(directory, PACKAGE_JSON); - if (fs.existsSync(packageJsonFilePath)) { - // $FlowFixMe - const packageJsonFileContents = require(packageJsonFilePath); - if (packageJsonFileContents[BABEL_CONFIG_KEY]) { - cache[directory] = JSON.stringify( - packageJsonFileContents[BABEL_CONFIG_KEY], - ); - break; - } - } - } - paths.forEach(directoryPath => (cache[directoryPath] = cache[directory])); - return cache[directory] || ''; - };*/ - options = Object.assign({}, options, { + options = {...options, plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), retainLines: true, - }); + }; delete options.cacheDirectory; delete options.filename; return { canInstrument: true, - /*getCacheKey(fileData: string, - filename: Path, - configString: string, - {instrument}: TransformOptions,): string { - return crypto - .createHash('md5') - .update(THIS_FILE) - .update('\0', 'utf8') - .update(fileData) - .update('\0', 'utf8') - .update(configString) - .update('\0', 'utf8') - .update(getBabelRC(filename)) - .update('\0', 'utf8') - .update(instrument ? 'instrument' : '') - .digest('hex'); - },*/ process(src: string, filename : string, config : JestConfig, diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 497fbbcbfc..5e0617496e 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -3,13 +3,14 @@ import * as crypto from 'crypto'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; -import { TransformOptions, Path, JestConfig } from "./jest-types"; +import { TransformOptions, Path, JestConfig } from './jest-types'; import { createTransformer } from './postprocess'; -const babelJest = createTransformer({ +const babelJestTransformer = createTransformer({ presets: [], plugins: ['transform-es2015-modules-commonjs'] }); + let tsJestConfig; export function process( @@ -49,7 +50,7 @@ export function process( const outputText = compilerOptions.allowSyntheticDefaultImports && !tsJestConfig.skipBabel - ? babelJest.process( + ? babelJestTransformer.process( tsTranspiled.outputText, path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ config, From 9229c4d8f8fc678de9263234859a14c3b1f13ea6 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Mon, 29 May 2017 15:05:41 +0200 Subject: [PATCH 173/256] I renamed a thing --- src/postprocess.ts | 3 +-- src/preprocessor.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index 5e290bb7f0..dbbb714920 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -5,8 +5,7 @@ import * as jestPreset from 'babel-preset-jest'; import { JestConfig, PostProcessorOptions, TransformOptions } from './jest-types'; import * as babel from 'babel-core'; - -export const createTransformer = (options: PostProcessorOptions) => { +export const createBabelTransformer = (options: PostProcessorOptions) => { options = {...options, plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 5e0617496e..37087e5cb8 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -4,9 +4,9 @@ import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; import { TransformOptions, Path, JestConfig } from './jest-types'; -import { createTransformer } from './postprocess'; +import { createBabelTransformer } from './postprocess'; -const babelJestTransformer = createTransformer({ +const babelJestTransformer = createBabelTransformer({ presets: [], plugins: ['transform-es2015-modules-commonjs'] }); From 1ad7e5f068de61a7d46f2ab41e36a311d484c27f Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Mon, 29 May 2017 15:47:20 +0200 Subject: [PATCH 174/256] I made the hook architecture a bit more modular --- src/jest-types.ts | 4 +++ src/postprocess.ts | 70 ++++++++++++++++++++++++++++----------------- src/preprocessor.ts | 17 ++++------- tslint.json | 4 --- 4 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/jest-types.ts b/src/jest-types.ts index e1e2980930..0409611e19 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -22,6 +22,10 @@ export interface PostProcessorOptions { filename?: string; } +export interface PostProcessHook { + (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions) : string; +} + export type JestConfig = Partial; export type FullJestConfig = { diff --git a/src/postprocess.ts b/src/postprocess.ts index dbbb714920..7f68530369 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -2,39 +2,55 @@ * Postprocess step. Stolen from babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js */ import * as jestPreset from 'babel-preset-jest'; -import { JestConfig, PostProcessorOptions, TransformOptions } from './jest-types'; +import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; import * as babel from 'babel-core'; +import { CompilerOptions } from 'typescript/lib/typescript'; -export const createBabelTransformer = (options: PostProcessorOptions) => { - options = {...options, +function createBabelTransformer(options: PostProcessorOptions) { + options = { + ...options, plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), retainLines: true, }; delete options.cacheDirectory; delete options.filename; - return { - canInstrument: true, - process(src: string, - filename : string, - config : JestConfig, - transformOptions : TransformOptions): string { - const theseOptions = Object.assign({filename}, options); - if (transformOptions && transformOptions.instrument) { - theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; - // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - require('babel-plugin-istanbul').default, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); - } - return babel.transform(src, theseOptions).code; - }, + + return (src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; }; -}; \ No newline at end of file +} + +export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig : any): PostProcessHook => { + if (tsJestConfig.skipBabel){ + return (src) => src; //Identity function + } + + //If we're not skipping babel + if (tsCompilerOptions.allowSyntheticDefaultImports) { + const plugins = ['transform-es2015-modules-commonjs']; + return createBabelTransformer({ + presets: [], + plugins: plugins, + }); + } + return (src) => src; //Identity function +}; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 37087e5cb8..1ad5118e78 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -3,15 +3,12 @@ import * as crypto from 'crypto'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; -import { TransformOptions, Path, JestConfig } from './jest-types'; -import { createBabelTransformer } from './postprocess'; +import { TransformOptions, Path, JestConfig, PostProcessHook } from './jest-types'; +import { getPostProcessHook } from './postprocess'; -const babelJestTransformer = createBabelTransformer({ - presets: [], - plugins: ['transform-es2015-modules-commonjs'] - }); let tsJestConfig; +let postHook : PostProcessHook; export function process( src: string, @@ -30,6 +27,7 @@ export function process( const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); + postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { src = 'module.exports=`' + src + '`;'; @@ -48,15 +46,12 @@ export function process( } ); - const outputText = - compilerOptions.allowSyntheticDefaultImports && !tsJestConfig.skipBabel - ? babelJestTransformer.process( + const outputText = postHook( tsTranspiled.outputText, path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ config, transformOptions - ) - : tsTranspiled.outputText; + ); // strip root part from path // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter diff --git a/tslint.json b/tslint.json index 1fa307a302..abf184469d 100644 --- a/tslint.json +++ b/tslint.json @@ -2,9 +2,6 @@ "rules": { "class-name": true, "forin": true, - "indent": [ - false - ], "label-position": true, "label-undefined": true, "no-arg": true, @@ -23,7 +20,6 @@ "no-empty": false, "no-eval": true, "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, "no-unused-expression": true, "no-unused-variable": [ true, From 54ca687750056ab8efac4d7c75b44f858e043fb9 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Mon, 29 May 2017 15:49:35 +0200 Subject: [PATCH 175/256] removed dep --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 9e3298ef52..afcb751d39 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ }, "dependencies": { "babel-core": "^6.24.1", - "babel-jest": "^20.0.0", "babel-plugin-istanbul": "^4.1.4", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-preset-jest": "^20.0.3", From 9cab2289dc9169dab5b668b5313d3ff0385ded1a Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 30 May 2017 01:23:12 +0530 Subject: [PATCH 176/256] Add link to current version of babel jest --- src/postprocess.ts | 17 +++++++++-------- yarn.lock | 12 +----------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index 7f68530369..7cc9f001d9 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -1,5 +1,6 @@ /** - * Postprocess step. Stolen from babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js + * Postprocess step. Based on babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js + * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js */ import * as jestPreset from 'babel-preset-jest'; import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; @@ -17,10 +18,10 @@ function createBabelTransformer(options: PostProcessorOptions) { delete options.filename; return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({filename}, options); + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({ filename }, options); if (transformOptions && transformOptions.instrument) { theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; // Copied from jest-runtime transform.js @@ -39,11 +40,11 @@ function createBabelTransformer(options: PostProcessorOptions) { }; } -export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig : any): PostProcessHook => { - if (tsJestConfig.skipBabel){ +export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { + if (tsJestConfig.skipBabel) { return (src) => src; //Identity function } - + //If we're not skipping babel if (tsCompilerOptions.allowSyntheticDefaultImports) { const plugins = ['transform-es2015-modules-commonjs']; diff --git a/yarn.lock b/yarn.lock index 86c3569115..e25f5c3e52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -268,10 +268,6 @@ babel-plugin-jest-hoist@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" -babel-plugin-jest-hoist@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.0.tgz#d2afe94fa6aea3b8bfa5d61d8028f633c898d86d" - babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" @@ -298,13 +294,7 @@ babel-preset-jest@^19.0.0: dependencies: babel-plugin-jest-hoist "^19.0.0" -babel-preset-jest@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.0.tgz#16b992c9351c2525e87a19fd36ba14e47df51bad" - dependencies: - babel-plugin-jest-hoist "^20.0.0" - -babel-preset-jest@^20.0.3: +babel-preset-jest@^20.0.0, babel-preset-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" dependencies: From c3c87bb3e4ecea00bfadd25bfd01ad53c414fd62 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 30 May 2017 01:23:46 +0530 Subject: [PATCH 177/256] Remove the 'js' suffix that was added for babel jest --- src/preprocessor.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 1ad5118e78..564f0fb9e6 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -8,7 +8,6 @@ import { getPostProcessHook } from './postprocess'; let tsJestConfig; -let postHook : PostProcessHook; export function process( src: string, @@ -27,7 +26,7 @@ export function process( const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); - postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); + let postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { src = 'module.exports=`' + src + '`;'; @@ -47,11 +46,11 @@ export function process( ); const outputText = postHook( - tsTranspiled.outputText, - path + '.js', // babel-jest only likes .js files ¯\_(ツ)_/¯ - config, - transformOptions - ); + tsTranspiled.outputText, + path, + config, + transformOptions + ); // strip root part from path // this results in a shorter filename which will also make the encoded base64 filename for the cache shorter From 83b9983a17ad1293b30f09f7e69163170230ebf9 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 30 May 2017 10:42:45 +0200 Subject: [PATCH 178/256] bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afcb751d39..fed3fd8a2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.4", + "version": "20.0.5", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From 29f7dd4f063d83685ada22c3d0774837b72a71be Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 30 May 2017 14:55:28 +0530 Subject: [PATCH 179/256] fix old version of ts-jest in yarn.lock --- yarn.lock | 1042 +++++++++++++---------------------------------------- 1 file changed, 260 insertions(+), 782 deletions(-) diff --git a/yarn.lock b/yarn.lock index e25f5c3e52..8d1356797d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,8 +7,8 @@ resolved "https://registry.yarnpkg.com/@types/es6-shim/-/es6-shim-0.31.33.tgz#4792bdecc8c7f09a7e086968cfbb8058e459379d" "@types/fs-extra@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.0.tgz#13e5566e4d780618ba52bd55e0dc713d7a687e59" + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.2.tgz#00cbf48563f377f9ce5cf24237b21b3d9779e055" dependencies: "@types/node" "*" @@ -17,12 +17,12 @@ resolved "https://registry.yarnpkg.com/@types/jest/-/jest-19.2.3.tgz#61748040e8589a891dfc2ec1d16a2dd74482980e" "@types/node@*", "@types/node@latest": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + version "7.0.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.22.tgz#4593f4d828bdd612929478ea40c67b4f403ca255" "@types/react@latest": - version "15.0.24" - resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.24.tgz#8a75299dc37906df327c18ca918bf97a55e7123b" + version "15.0.25" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.25.tgz#d396949cccc9a90b61755def9781e5aced9b2261" "@types/source-map-support@latest": version "0.2.28" @@ -34,10 +34,6 @@ abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" -abbrev@1, abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - acorn-globals@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" @@ -45,8 +41,8 @@ acorn-globals@^3.1.0: acorn "^4.0.4" acorn@^4.0.4: - version "4.0.11" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" ajv@^4.9.1: version "4.11.8" @@ -63,7 +59,7 @@ align-text@^0.1.1, align-text@^0.1.3: longest "^1.0.1" repeat-string "^1.5.2" -amdefine@>=0.0.4, amdefine@^1.0.0: +amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -77,7 +73,7 @@ ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-regex@^2.0.0: +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -120,22 +116,10 @@ arr-flatten@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" - array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - -array-uniq@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -160,13 +144,13 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -async@1.x, async@^1.4.0: +async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.4.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + version "2.4.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" dependencies: lodash "^4.14.0" @@ -234,21 +218,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" - dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^19.0.0" - -babel-jest@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.0.tgz#05ae371102ee8e30c9d61ffdf3f61c738a87741f" +babel-jest@^20.0.0, babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^20.0.0" + babel-preset-jest "^20.0.3" babel-messages@^6.23.0: version "6.23.0" @@ -264,10 +240,6 @@ babel-plugin-istanbul@^4.0.0, babel-plugin-istanbul@^4.1.4: istanbul-lib-instrument "^1.7.2" test-exclude "^4.1.1" -babel-plugin-jest-hoist@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" - babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" @@ -288,13 +260,7 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-preset-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" - dependencies: - babel-plugin-jest-hoist "^19.0.0" - -babel-preset-jest@^20.0.0, babel-preset-jest@^20.0.3: +babel-preset-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" dependencies: @@ -353,8 +319,8 @@ babel-types@^6.18.0, babel-types@^6.24.1: to-fast-properties "^1.0.1" babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + version "6.17.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f" bail@^1.0.0: version "1.0.1" @@ -370,10 +336,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -384,7 +346,7 @@ boundary@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/boundary/-/boundary-1.0.1.tgz#4d67dc2602c0cc16dd9bce7ebf87e948290f5812" -brace-expansion@^1.0.0: +brace-expansion@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" dependencies: @@ -417,6 +379,10 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -425,21 +391,10 @@ callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" @@ -463,7 +418,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.1.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -509,14 +464,6 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" -clone-stats@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - -clone@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -611,32 +558,19 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - dependencies: - array-find-index "^1.0.1" - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" dependencies: assert-plus "^1.0.0" -dateformat@^1.0.11: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.3: - version "2.6.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: - ms "0.7.3" + ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -660,7 +594,7 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@^3.0.0, diff@^3.0.1, diff@^3.2.0: +diff@^3.0.1, diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -691,24 +625,18 @@ domelementtype@~1.1.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" domhandler@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + version "2.4.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259" dependencies: domelementtype "1" domutils@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.0.tgz#853de07f013287f976b7fe0461740222ea14ecbb" + version "1.6.2" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.2.tgz#1958cc0b4c9426e9ed367fb1c8e854891b0fa3ff" dependencies: dom-serializer "0" domelementtype "1" -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - dependencies: - readable-stream "~1.1.9" - duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -749,7 +677,7 @@ escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escodegen@1.8.x, escodegen@^1.6.1: +escodegen@^1.6.1: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" dependencies: @@ -760,7 +688,7 @@ escodegen@1.8.x, escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -esprima@2.7.x, esprima@^2.7.1: +esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -832,13 +760,6 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" -fancy-log@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" - dependencies: - chalk "^1.1.1" - time-stamp "^1.0.0" - fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -933,13 +854,6 @@ from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" -fs-extra@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - fs-extra@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" @@ -960,10 +874,6 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" @@ -997,24 +907,24 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^5.0.15, glob@~5.0.0: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" +glob@~5.0.0: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" dependencies: - fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.2" + minimatch "2 || 3" once "^1.3.0" path-is-absolute "^1.0.0" @@ -1022,12 +932,6 @@ globals@^9.0.0: version "9.17.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" -glogg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" - dependencies: - sparkles "^1.0.0" - graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -1036,38 +940,9 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -gulp-util@3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^1.0.11" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - dependencies: - glogg "^1.0.0" - -handlebars@^4.0.1, handlebars@^4.0.3: - version "4.0.8" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.8.tgz#22b875cd3f0e6cbea30314f144e82bc7a72ff420" +handlebars@^4.0.3: + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" dependencies: async "^1.4.0" optimist "^0.6.1" @@ -1096,12 +971,6 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - dependencies: - sparkles "^1.0.0" - has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -1161,12 +1030,6 @@ iconv-lite@0.4.13, iconv-lite@~0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1293,10 +1156,6 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1323,32 +1182,32 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" istanbul-api@^1.1.1: - version "1.1.8" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + version "1.1.9" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.9.tgz#2827920d380d4286d857d57a2968a841db8a7ec8" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.0" - istanbul-lib-hook "^1.0.6" - istanbul-lib-instrument "^1.7.1" - istanbul-lib-report "^1.1.0" - istanbul-lib-source-maps "^1.2.0" - istanbul-reports "^1.1.0" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.0.7" + istanbul-lib-instrument "^1.7.2" + istanbul-lib-report "^1.1.1" + istanbul-lib-source-maps "^1.2.1" + istanbul-reports "^1.1.1" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0, istanbul-lib-coverage@^1.1.1: +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" -istanbul-lib-hook@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" +istanbul-lib-hook@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1, istanbul-lib-instrument@^1.7.2: +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" dependencies: @@ -1360,57 +1219,38 @@ istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-ins istanbul-lib-coverage "^1.1.1" semver "^5.3.0" -istanbul-lib-report@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" +istanbul-lib-report@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" dependencies: - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" dependencies: debug "^2.6.3" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" +istanbul-reports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" dependencies: handlebars "^4.0.3" -istanbul@0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -jest-changed-files@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.0.tgz#2ad82870a815b40ce3f4bf4555581d387b21022c" - -jest-cli@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.0.tgz#72664e0723bd099a0bade5bd4bf960fd54876069" +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" + +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" @@ -1421,18 +1261,18 @@ jest-cli@^20.0.0: istanbul-lib-coverage "^1.0.1" istanbul-lib-instrument "^1.4.2" istanbul-lib-source-maps "^1.1.0" - jest-changed-files "^20.0.0" - jest-config "^20.0.0" - jest-docblock "^20.0.0" - jest-environment-jsdom "^20.0.0" - jest-haste-map "^20.0.0" - jest-jasmine2 "^20.0.0" - jest-message-util "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve-dependencies "^20.0.0" - jest-runtime "^20.0.0" - jest-snapshot "^20.0.0" - jest-util "^20.0.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" micromatch "^2.3.11" node-notifier "^5.0.2" pify "^2.3.0" @@ -1443,310 +1283,177 @@ jest-cli@^20.0.0: worker-farm "^1.3.1" yargs "^7.0.2" -jest-config@^19.0.0: - version "19.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" - dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^19.0.2" - jest-environment-node "^19.0.2" - jest-jasmine2 "^19.0.2" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.2" - jest-validate "^19.0.2" - pretty-format "^19.0.0" - -jest-config@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.0.tgz#295fe937a377f79a8eea240ad29546bf43acbbec" +jest-config@^20.0.0, jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" dependencies: chalk "^1.1.3" glob "^7.1.1" - jest-environment-jsdom "^20.0.0" - jest-environment-node "^20.0.0" - jest-jasmine2 "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve "^20.0.0" - jest-validate "^20.0.0" - pretty-format "^20.0.0" - -jest-diff@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" - dependencies: - chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^19.0.0" - pretty-format "^19.0.0" - -jest-diff@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.0.tgz#d6e9190b57e0333c6706ef28d62b1cb23042d7eb" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" dependencies: chalk "^1.1.3" diff "^3.2.0" - jest-matcher-utils "^20.0.0" - pretty-format "^20.0.0" - -jest-docblock@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.0.tgz#5b647c4af36f52dae74df1949a8cb418d146ad3a" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" -jest-environment-jsdom@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" - jsdom "^9.11.0" +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" -jest-environment-jsdom@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.0.tgz#a688499d817e33cdea6400c502d8d5f4aa01c808" +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" dependencies: - jest-mock "^20.0.0" - jest-util "^20.0.0" + jest-mock "^20.0.3" + jest-util "^20.0.3" jsdom "^9.12.0" -jest-environment-node@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" - -jest-environment-node@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.0.tgz#7016d8d1270cbc1ed71a10f242c78324297e1db8" +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" dependencies: - jest-mock "^20.0.0" - jest-util "^20.0.0" - -jest-file-exists@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" + jest-mock "^20.0.3" + jest-util "^20.0.3" -jest-haste-map@^19.0.0: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" - dependencies: - fb-watchman "^2.0.0" - graceful-fs "^4.1.6" - micromatch "^2.3.11" - sane "~1.5.0" - worker-farm "^1.3.1" - -jest-haste-map@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.0.tgz#3b8d9255dfe2a6a96e516fe71dafd415e1b5d65f" +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^20.0.0" + jest-docblock "^20.0.3" micromatch "^2.3.11" sane "~1.6.0" worker-farm "^1.3.1" -jest-jasmine2@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" - dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^19.0.0" - jest-matchers "^19.0.0" - jest-message-util "^19.0.0" - jest-snapshot "^19.0.2" - -jest-jasmine2@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.0.tgz#2a0aba92ed36ec132901cfc2a552fd7cee6fde3d" +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" dependencies: chalk "^1.1.3" graceful-fs "^4.1.11" - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-matchers "^20.0.0" - jest-message-util "^20.0.0" - jest-snapshot "^20.0.0" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" once "^1.4.0" p-map "^1.1.1" -jest-matcher-utils@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" - dependencies: - chalk "^1.1.3" - pretty-format "^19.0.0" - -jest-matcher-utils@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.0.tgz#2c5d9dd11670c5418ffc78baecf9094db9e91e09" +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" dependencies: chalk "^1.1.3" - pretty-format "^20.0.0" - -jest-matchers@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" - dependencies: - jest-diff "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" - -jest-matchers@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.0.tgz#55498637bbb58f164d97c73610fb8d016dfac770" - dependencies: - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-message-util "^20.0.0" - jest-regex-util "^20.0.0" + pretty-format "^20.0.3" -jest-message-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" dependencies: - chalk "^1.1.1" - micromatch "^2.3.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" -jest-message-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.0.tgz#060bac1980bd5e11134e8e1c19c94863d937c727" +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" dependencies: chalk "^1.1.3" micromatch "^2.3.11" slash "^1.0.0" -jest-mock@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" - -jest-mock@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.0.tgz#3c54b94fe502ed57f2e602fab22ab196a7aa4b95" - -jest-regex-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" - -jest-regex-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.0.tgz#7f6051e9d00fdcccca52bade50aabdd9919bcfd2" +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" -jest-resolve-dependencies@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.0.tgz#616c6976c52e49d13e6420b1bcc8f380e701408f" - dependencies: - jest-regex-util "^20.0.0" +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" -jest-resolve@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" dependencies: - browser-resolve "^1.11.2" - jest-haste-map "^19.0.0" - resolve "^1.2.0" + jest-regex-util "^20.0.3" -jest-resolve@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.0.tgz#f9bfdfa31109aee2decfc3a07c2c354608cc5e1d" +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" dependencies: browser-resolve "^1.11.2" is-builtin-module "^1.0.0" resolve "^1.3.2" -jest-runtime@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.0.tgz#4c78c08573ffaeba9b8ceb096f705b75d5fb54a1" +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" dependencies: babel-core "^6.0.0" - babel-jest "^20.0.0" + babel-jest "^20.0.3" babel-plugin-istanbul "^4.0.0" chalk "^1.1.3" convert-source-map "^1.4.0" graceful-fs "^4.1.11" - jest-config "^20.0.0" - jest-haste-map "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve "^20.0.0" - jest-util "^20.0.0" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" json-stable-stringify "^1.0.1" micromatch "^2.3.11" strip-bom "3.0.0" yargs "^7.0.2" -jest-snapshot@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" - dependencies: - chalk "^1.1.3" - jest-diff "^19.0.0" - jest-file-exists "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-util "^19.0.2" - natural-compare "^1.4.0" - pretty-format "^19.0.0" - -jest-snapshot@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.0.tgz#fbe51d94ed1c6cd23808bb7ef82e58ca12a0ccf7" +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" dependencies: chalk "^1.1.3" - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-util "^20.0.0" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" natural-compare "^1.4.0" - pretty-format "^20.0.0" - -jest-util@^19.0.0, jest-util@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" - dependencies: - chalk "^1.1.1" - graceful-fs "^4.1.6" - jest-file-exists "^19.0.0" - jest-message-util "^19.0.0" - jest-mock "^19.0.0" - jest-validate "^19.0.2" - leven "^2.0.0" - mkdirp "^0.5.1" + pretty-format "^20.0.3" -jest-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.0.tgz#5421322f196e884e962bc8b8bac4b009733caed9" +jest-util@^20.0.0, jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" dependencies: chalk "^1.1.3" graceful-fs "^4.1.11" - jest-message-util "^20.0.0" - jest-mock "^20.0.0" - jest-validate "^20.0.0" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" leven "^2.1.0" mkdirp "^0.5.1" -jest-validate@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" - dependencies: - chalk "^1.1.1" - jest-matcher-utils "^19.0.0" - leven "^2.0.0" - pretty-format "^19.0.0" - -jest-validate@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.0.tgz#c0832e8210190b6d5b39a46b8df536083131a7d7" +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" dependencies: chalk "^1.1.3" - jest-matcher-utils "^20.0.0" + jest-matcher-utils "^20.0.3" leven "^2.1.0" - pretty-format "^20.0.0" + pretty-format "^20.0.3" jest@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.0.tgz#58cf6abf328f2a2e3c4203890131cbe89d3b0769" + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" dependencies: - jest-cli "^20.0.0" + jest-cli "^20.0.4" jodid25519@^1.0.0: version "1.0.2" @@ -1758,9 +1465,9 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@3.x, js-yaml@^3.7.0: - version "3.8.3" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" +js-yaml@^3.7.0: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" @@ -1769,7 +1476,7 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^9.11.0, jsdom@^9.12.0: +jsdom@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" dependencies: @@ -1815,12 +1522,6 @@ json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" @@ -1841,8 +1542,8 @@ jsprim@^1.2.2: verror "1.3.6" kind-of@^3.0.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07" + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" dependencies: is-buffer "^1.1.5" @@ -1856,7 +1557,7 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -leven@^2.0.0, leven@^2.1.0: +leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -1893,105 +1594,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - -lodash.assign@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - dependencies: - lodash._root "^3.0.0" - -lodash.includes@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.partition@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.partition/-/lodash.partition-4.6.0.tgz#a38e46b73469e0420b0da1212e66d414be364ba4" - -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash@^4.14.0, lodash@^4.2.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2004,19 +1606,12 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" @@ -2030,10 +1625,6 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" @@ -2057,21 +1648,6 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -meow@^3.3.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" @@ -2108,11 +1684,11 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8, minimist@~0.0.1: version "0.0.8" @@ -2122,33 +1698,27 @@ minimist@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" -minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@~1.2.0: +minimist@^1.1.1, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@0.5.x, mkdirp@^0.5.1: +mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" - -multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - dependencies: - duplexer2 "0.0.2" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" node-fetch@^1.0.1: - version "1.6.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" + version "1.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.0.tgz#3ff6c56544f9b7fb00682338bb55ee6f54a8a0ef" dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -2166,13 +1736,7 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - dependencies: - abbrev "1" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.3.2: version "2.3.8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" dependencies: @@ -2198,17 +1762,13 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.3.9" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" + version "1.4.0" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2220,7 +1780,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@1.x, once@^1.3.0, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2389,16 +1949,11 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" - dependencies: - ansi-styles "^3.0.0" - -pretty-format@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.0.tgz#bd100f330e707e4f49fef3f234d6e915242a6e7e" +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" dependencies: + ansi-regex "^2.1.1" ansi-styles "^3.0.0" private@^0.1.6: @@ -2416,10 +1971,11 @@ promise@^7.1.1: asap "~2.0.3" prop-types@^15.5.7: - version "15.5.8" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + version "15.5.10" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: fbjs "^0.8.9" + loose-envify "^1.3.1" prr@~0.0.0: version "0.0.0" @@ -2496,33 +2052,18 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.2, readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" +readable-stream@^2.0.2: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" dependencies: + buffer-shims "~1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" process-nextick-args "~1.0.6" - string_decoder "~0.10.x" + string_decoder "~1.0.0" util-deprecate "~1.0.1" -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - regenerator-runtime@^0.10.0: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" @@ -2534,17 +2075,6 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" -remap-istanbul@^0.9.5: - version "0.9.5" - resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.9.5.tgz#a18617b1f31eec5a7dbee77538298b775606aaa8" - dependencies: - amdefine "^1.0.0" - gulp-util "3.0.7" - istanbul "0.4.5" - minimatch "^3.0.3" - source-map ">=0.5.6" - through2 "2.0.1" - remark-parse@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-1.1.0.tgz#c3ca10f9a8da04615c28f09aa4e304510526ec21" @@ -2598,10 +2128,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - request@^2.79.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -2637,11 +2163,11 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -resolve@1.1.7, resolve@1.1.x: +resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.2: +resolve@^1.1.7, resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -2663,18 +2189,6 @@ safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" -sane@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" - dependencies: - anymatch "^1.3.0" - exec-sh "^0.2.0" - fb-watchman "^1.8.0" - minimatch "^3.0.2" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.10.0" - sane@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" @@ -2737,26 +2251,22 @@ source-map-support@^0.4.2, source-map-support@^0.4.4: dependencies: source-map "^0.5.6" -source-map@>=0.5.6, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" dependencies: amdefine ">=0.0.4" -sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -2823,9 +2333,11 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" + dependencies: + safe-buffer "^5.0.1" stringify-entities@^1.0.1: version "1.3.0" @@ -2861,12 +2373,6 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - dependencies: - get-stdin "^4.0.1" - strip-json-comments@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2881,7 +2387,7 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0, supports-color@^3.1.2: +supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -2905,21 +2411,10 @@ throat@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" -through2@2.0.1, through2@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9" - dependencies: - readable-stream "~2.0.0" - xtend "~4.0.0" - through@2, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -time-stamp@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" - tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -2942,10 +2437,6 @@ traverse@^0.6.6: version "0.6.6" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -2963,24 +2454,19 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" ts-jest@latest: - version "19.0.14" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-19.0.14.tgz#88674b956e048f61b0ab28d421bfdabbb641be5c" + version "20.0.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.4.tgz#ffe3987d48c8762cd7b6ae83518d203eca167618" dependencies: - babel-jest "^19.0.0" + babel-jest "^20.0.0" babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - fs-extra "^2.1.2" + fs-extra "^3.0.0" glob-all "^3.1.0" - istanbul-lib-instrument "^1.2.0" - jest-config "^19.0.0" - jest-util "^19.0.0" - lodash.assign "^4.2.0" - lodash.includes "^4.3.0" - lodash.partition "^4.6.0" - lodash.pickby "^4.6.0" - remap-istanbul "^0.9.5" + jest-config "^20.0.0" + jest-util "^20.0.0" + pkg-dir "^2.0.0" source-map-support "^0.4.4" tsconfig "^6.0.0" - yargs "^7.0.2" + yargs "^8.0.1" tsconfig@^6.0.0: version "6.0.0" @@ -3003,8 +2489,8 @@ tslint@next: tsutils "^1.1.0" tsutils@^1.1.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.8.0.tgz#bf8118ed8e80cd5c9fc7d75728c7963d44ed2f52" + version "1.9.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" tunnel-agent@^0.6.0: version "0.6.0" @@ -3023,16 +2509,16 @@ type-check@~0.3.2: prelude-ls "~1.1.2" typescript@latest: - version "2.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" + version "2.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.3.tgz#9639f3c3b40148e8ca97fe08a51dd1891bb6be22" ua-parser-js@^0.7.9: version "0.7.12" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" uglify-js@^2.6: - version "2.8.22" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + version "2.8.27" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c" dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -3112,14 +2598,6 @@ vfile@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/vfile/-/vfile-1.4.0.tgz#c0fd6fa484f8debdb771f68c31ed75d88da97fe7" -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" @@ -3149,8 +2627,8 @@ whatwg-fetch@>=0.10.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" whatwg-url@^4.3.0: - version "4.7.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -3163,7 +2641,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.1.1, which@^1.2.12, which@^1.2.9: +which@^1.2.12, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -3177,14 +2655,14 @@ wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + worker-farm@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" @@ -3207,7 +2685,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1, xtend@~4.0.0: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 544a0a9871d9cf9ece311b673f7ff890096c996c Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 30 May 2017 12:47:04 +0200 Subject: [PATCH 180/256] Updated dependencies, added regression tests and cleaned up tests --- .../__snapshots__/html-transform.spec.ts.snap | 4 +- .../regression-tests.spec.ts.snap | 176 +++ tests/__tests__/html-transform.spec.ts | 12 +- tests/__tests__/regression-tests.spec.ts | 60 + tests/__tests__/ts-compilation.spec.ts | 4 +- tests/__tests__/ts-coverage-async.spec.ts | 4 +- tests/__tests__/ts-coverage.spec.ts | 4 +- tests/__tests__/ts-errors.spec.ts | 2 +- tests/__tests__/tsx-compilation.spec.ts | 4 +- tests/__tests__/tsx-errors.spec.ts | 2 +- tests/__tests__/watch.spec.ts | 2 +- yarn.lock | 1062 ++++------------- 12 files changed, 518 insertions(+), 818 deletions(-) create mode 100644 tests/__tests__/__snapshots__/regression-tests.spec.ts.snap create mode 100644 tests/__tests__/regression-tests.spec.ts diff --git a/tests/__tests__/__snapshots__/html-transform.spec.ts.snap b/tests/__tests__/__snapshots__/html-transform.spec.ts.snap index d2ed4c69ff..bdea8378b9 100644 --- a/tests/__tests__/__snapshots__/html-transform.spec.ts.snap +++ b/tests/__tests__/__snapshots__/html-transform.spec.ts.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`transforms html if config.globals.__TRANSFORM_HTML__ is set 1`] = ` +exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set 1`] = ` "module.exports=\`
This is element
\`;" `; -exports[`transforms html if config.globals.__TRANSFORM_HTML__ is set 2`] = ` +exports[`Html transforms transforms html if config.globals.__TRANSFORM_HTML__ is set 2`] = ` "
This is element
" diff --git a/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap b/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap new file mode 100644 index 0000000000..330b996361 --- /dev/null +++ b/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Process regession tests Should not change the output of process that compiles .ts files 1`] = ` +"'use strict';require('ts-jest').install();\\"use strict\\"; +exports.__esModule = true; +var Hello = (function () { + function Hello() { + var greeting = \\"\\\\n this\\\\n is\\\\n a\\\\n multiline\\\\n greeting\\\\n \\"; + this.unexcuted(function () { }); + throw new Error('Hello error!'); + } + Hello.prototype.unexcuted = function (action) { + if (action === void 0) { action = function () { }; } + if (action) { + action(); + } + else { + console.log('unexcuted'); + } + }; + return Hello; +}()); +exports.Hello = Hello; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSGVsbG8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJIZWxsby50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBO0lBQ0U7UUFDRSxJQUFNLFFBQVEsR0FBRyx3RUFNaEIsQ0FBQztRQUVGLElBQUksQ0FBQyxTQUFTLENBQUMsY0FBUSxDQUFDLENBQUMsQ0FBQztRQUUxQixNQUFNLElBQUksS0FBSyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQ2xDLENBQUM7SUFFTSx5QkFBUyxHQUFoQixVQUFpQixNQUE4QjtRQUE5Qix1QkFBQSxFQUFBLHVCQUE2QixDQUFDO1FBQzdDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7WUFDWCxNQUFNLEVBQUUsQ0FBQztRQUNYLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDM0IsQ0FBQztJQUNILENBQUM7SUFDSCxZQUFDO0FBQUQsQ0FBQyxBQXRCRCxJQXNCQztBQXRCWSxzQkFBSyJ9" +`; + +exports[`Process regession tests Should not change the output of process that compiles .ts files with syntheticdefaultimport 1`] = ` +"'use strict';require('ts-jest').install();\\"use strict\\"; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var _module = require(\\"../module\\");var _module2 = _interopRequireDefault(_module); +require(\\"jest\\");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {return new (P || (P = Promise))(function (resolve, reject) {function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}}function rejected(value) {try {step(generator[\\"throw\\"](value));} catch (e) {reject(e);}}function step(result) {result.done ? resolve(result.value) : new P(function (resolve) {resolve(result.value);}).then(fulfilled, rejected);}step((generator = generator.apply(thisArg, _arguments || [])).next());});};var __generator = undefined && undefined.__generator || function (thisArg, body) {var _ = { label: 0, sent: function () {if (t[0] & 1) throw t[1];return t[1];}, trys: [], ops: [] },f,y,t,g;return g = { next: verb(0), \\"throw\\": verb(1), \\"return\\": verb(2) }, typeof Symbol === \\"function\\" && (g[Symbol.iterator] = function () {return this;}), g;function verb(n) {return function (v) {return step([n, v]);};}function step(op) {if (f) throw new TypeError(\\"Generator is already executing.\\");while (_) try {if (f = 1, y && (t = y[op[0] & 2 ? \\"return\\" : op[0] ? \\"throw\\" : \\"next\\"]) && !(t = t.call(y, op[1])).done) return t;if (y = 0, t) op = [0, t.value];switch (op[0]) {case 0:case 1:t = op;break;case 4:_.label++;return { value: op[1], done: false };case 5:_.label++;y = op[1];op = [0];continue;case 7:op = _.ops.pop();_.trys.pop();continue;default:if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {_ = 0;continue;}if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;}if (op[0] === 6 && _.label < t[1]) {_.label = t[1];t = op;break;}if (t && _.label < t[2]) {_.label = t[2];_.ops.push(op);break;}if (t[2]) _.ops.pop();_.trys.pop();continue;}op = body.call(thisArg, _);} catch (e) {op = [6, e];y = 0;} finally {f = t = 0;}if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true };}};var _this = undefined; +describe('the module which has no default export', function () { + it('should return sensible values when trying to access its exports', function () { + expect(_module2.default.someExport).toBe('someExport'); + }); +}); +function noop() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, Promise.resolve('noop')]; + }); + }); +} +describe('async-await stuff', function () { + it('should be compiled by TS not Babel', function (done) {return __awaiter(_this, void 0, void 0, function () { + var g; + return __generator(this, function (_a) { + switch (_a.label) { + case 0:return [4 /*yield*/, noop()]; + case 1: + g = _a.sent(); + expect(g).toBe('noop'); + done(); + return [2 /*return*/];} + + }); + });}); +});" +`; + +exports[`Process regession tests Should not change the output of process that compiles .tsx files 1`] = ` +"'use strict';require('ts-jest').install();\\"use strict\\"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +exports.__esModule = true; +var React = require(\\"react\\"); +; +var Button = (function (_super) { + __extends(Button, _super); + function Button() { + return _super !== null && _super.apply(this, arguments) || this; + } + Button.prototype.render = function () { + return (
{this.props.children}
); + }; + return Button; +}(React.Component)); +exports.Button = Button; +var BadButton = (function (_super) { + __extends(BadButton, _super); + function BadButton() { + return _super !== null && _super.apply(this, arguments) || this; + } + BadButton.prototype.render = function () { + \\"\\\\n \\\\n \\"; + if (1 == 1) + throw new Error('Error in Bad button'); + return (
{this.props.children}
); + }; + return BadButton; +}(React.Component)); +exports.BadButton = BadButton; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQnV0dG9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSw2QkFBK0I7QUFFTixDQUFDO0FBRTFCO0lBQTRCLDBCQUFrQztJQUE5RDs7SUFNQSxDQUFDO0lBTEMsdUJBQU0sR0FBTjtRQUNFLE1BQU0sQ0FBQyxDQUNMLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUNwRCxDQUFDO0lBQ0osQ0FBQztJQUNILGFBQUM7QUFBRCxDQUFDLEFBTkQsQ0FBNEIsS0FBSyxDQUFDLFNBQVMsR0FNMUM7QUFOWSx3QkFBTTtBQVFuQjtJQUErQiw2QkFBa0M7SUFBakU7O0lBVUEsQ0FBQztJQVRDLDBCQUFNLEdBQU47UUFDRSxjQUVDLENBQUM7UUFDRixFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO1FBQ25ELE1BQU0sQ0FBQyxDQUNMLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUN4RCxDQUFDO0lBQ0osQ0FBQztJQUNILGdCQUFDO0FBQUQsQ0FBQyxBQVZELENBQStCLEtBQUssQ0FBQyxTQUFTLEdBVTdDO0FBVlksOEJBQVMifQ==" +`; + +exports[`Process regession tests Should not change the output of process that compiles .tsx files with syntheticdefaultimport 1`] = ` +"'use strict';require('ts-jest').install();\\"use strict\\";Object.defineProperty(exports, \\"__esModule\\", { value: true });exports.BadButton = exports.Button = undefined; + + + + + + + + + +var _react = require(\\"react\\");var React = _interopRequireWildcard(_react);function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}}var __extends = undefined && undefined.__extends || function () {var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {d.__proto__ = b;} || function (d, b) {for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];};return function (d, b) {extendStatics(d, b);function __() {this.constructor = d;}d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());};}(); +; +var Button = function (_super) { + __extends(Button, _super); + function Button() { + return _super !== null && _super.apply(this, arguments) || this; + } + Button.prototype.render = function () { + return React.createElement(\\"div\\", { className: \\"button\\" }, this.props.children); + }; + return Button; +}(React.Component);exports. +Button = Button; +var BadButton = function (_super) { + __extends(BadButton, _super); + function BadButton() { + return _super !== null && _super.apply(this, arguments) || this; + } + BadButton.prototype.render = function () { + \\"\\\\n \\\\n \\"; + if (1 == 1) + throw new Error('Error in Bad button'); + return React.createElement(\\"div\\", { className: \\"bad-button\\" }, this.props.children); + }; + return BadButton; +}(React.Component);exports. +BadButton = BadButton;" +`; diff --git a/tests/__tests__/html-transform.spec.ts b/tests/__tests__/html-transform.spec.ts index 9305bbf0b8..d6d0145e9a 100644 --- a/tests/__tests__/html-transform.spec.ts +++ b/tests/__tests__/html-transform.spec.ts @@ -11,8 +11,10 @@ const config = { } }; -test('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(); -}); +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(); + }); +}); \ No newline at end of file diff --git a/tests/__tests__/regression-tests.spec.ts b/tests/__tests__/regression-tests.spec.ts new file mode 100644 index 0000000000..f3b0514f03 --- /dev/null +++ b/tests/__tests__/regression-tests.spec.ts @@ -0,0 +1,60 @@ +import { process } from '../../src/preprocessor'; +import * as fs from 'fs'; + +const globalConfig = { + cacheDirectory: + '/tmp/cacheStuff', + globals: { + __TS_CONFIG__: { + + } + } +}; + +const allowSyntheticDefaultImportsConfig = { + cacheDirectory: + '/tmp/cacheStuff', + globals: { + __TS_CONFIG__: { + allowSyntheticDefaultImports: true, + jsx: 'react', + } + } +}; + +describe('Process regession tests', () => { + it('Should not change the output of process that compiles .ts files', () => { + const src = fs.readFileSync('./tests/simple/Hello.ts', 'utf-8'); + const path = './tests/simple/Hello.ts'; + const outcome = process(src, path, globalConfig); + + expect(outcome).toMatchSnapshot(); + }); + + it('Should not change the output of process that compiles .tsx files', () => { + const src = fs.readFileSync('./tests/button/Button.tsx', 'utf-8'); + const path = './tests/simple/Button.tsx'; + const outcome = process(src, path, globalConfig); + + expect(outcome).toMatchSnapshot(); + }); + + it('Should not change the output of process that compiles .ts files with syntheticdefaultimport', () => { + const src = fs.readFileSync('./tests/synthetic-default/__tests__/module.test.ts', 'utf-8'); + const path = './tests/synthetic-default/__tests__/module.test.ts'; + const outcome = process(src, path, allowSyntheticDefaultImportsConfig); + + expect(outcome).toMatchSnapshot(); + }); + + + it('Should not change the output of process that compiles .tsx files with syntheticdefaultimport', () => { + const src = fs.readFileSync('./tests/button/Button.tsx', 'utf-8'); + const path = './tests/button/Button.tsx'; + const outcome = process(src, path, allowSyntheticDefaultImportsConfig); + + expect(outcome).toMatchSnapshot(); + }); + + +}); \ No newline at end of file diff --git a/tests/__tests__/ts-compilation.spec.ts b/tests/__tests__/ts-compilation.spec.ts index 3e98918783..30af1d2b05 100644 --- a/tests/__tests__/ts-compilation.spec.ts +++ b/tests/__tests__/ts-compilation.spec.ts @@ -1,8 +1,8 @@ import runJest from '../__helpers__/runJest'; -describe('hello_world', () => { +describe('TS Compilation', () => { - it('should run successfully', () => { + it('should compile typescript succesfully', () => { const result = runJest('../simple', ['--no-cache']); diff --git a/tests/__tests__/ts-coverage-async.spec.ts b/tests/__tests__/ts-coverage-async.spec.ts index 3a13305c7b..0f5c05ca85 100644 --- a/tests/__tests__/ts-coverage-async.spec.ts +++ b/tests/__tests__/ts-coverage-async.spec.ts @@ -1,8 +1,8 @@ import runJest from '../__helpers__/runJest'; -describe('hello_world', () => { +describe('Typescript async coverage', () => { - it('should run successfully', () => { + it('Should generate the correct async coverage numbers', () => { const result = runJest('../simple-async', ['--no-cache', '--coverage']); const output = result.stdout.toString(); diff --git a/tests/__tests__/ts-coverage.spec.ts b/tests/__tests__/ts-coverage.spec.ts index ce501ed548..e56410f1a0 100644 --- a/tests/__tests__/ts-coverage.spec.ts +++ b/tests/__tests__/ts-coverage.spec.ts @@ -1,8 +1,8 @@ import runJest from '../__helpers__/runJest'; -describe('hello_world', () => { +describe('Typescript coverage', () => { - it('should run successfully', () => { + it('Should generate the correct coverage numbers.', () => { const result = runJest('../simple', ['--no-cache', '--coverage']); const output = result.stdout.toString(); diff --git a/tests/__tests__/ts-errors.spec.ts b/tests/__tests__/ts-errors.spec.ts index 81899f8001..74e5a34a3a 100644 --- a/tests/__tests__/ts-errors.spec.ts +++ b/tests/__tests__/ts-errors.spec.ts @@ -1,6 +1,6 @@ import runJest from '../__helpers__/runJest'; -describe('hello_world', () => { +describe('Typescript errors', () => { it('should show the correct error locations in the typescript files', () => { diff --git a/tests/__tests__/tsx-compilation.spec.ts b/tests/__tests__/tsx-compilation.spec.ts index 62e38e7628..8360cd3e3a 100644 --- a/tests/__tests__/tsx-compilation.spec.ts +++ b/tests/__tests__/tsx-compilation.spec.ts @@ -1,8 +1,8 @@ import runJest from '../__helpers__/runJest'; -describe('button', () => { +describe('TSX Compilation', () => { - it('should run successfully', () => { + it('Should compile a button succesfully', () => { const result = runJest('../button', ['--no-cache', '-u']); diff --git a/tests/__tests__/tsx-errors.spec.ts b/tests/__tests__/tsx-errors.spec.ts index cb410f7b1f..392fcc40fa 100644 --- a/tests/__tests__/tsx-errors.spec.ts +++ b/tests/__tests__/tsx-errors.spec.ts @@ -1,6 +1,6 @@ import runJest from '../__helpers__/runJest'; -describe('button', () => { +describe('TSX Errors', () => { it('should show the correct error locations in the typescript files', () => { diff --git a/tests/__tests__/watch.spec.ts b/tests/__tests__/watch.spec.ts index 411b2ec71b..e72b0b0b7e 100644 --- a/tests/__tests__/watch.spec.ts +++ b/tests/__tests__/watch.spec.ts @@ -44,7 +44,7 @@ describe('Hello Class', () => { }); `; -describe('hello_world', () => { +describe('Typescript watch tests', () => { let result: { childProcess: ChildProcess, getStderrAsync: () => Promise }; let DEFAULT_TIMEOUT_INTERVAL: number; diff --git a/yarn.lock b/yarn.lock index e25f5c3e52..3c3ff92a87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,8 +7,8 @@ resolved "https://registry.yarnpkg.com/@types/es6-shim/-/es6-shim-0.31.33.tgz#4792bdecc8c7f09a7e086968cfbb8058e459379d" "@types/fs-extra@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.0.tgz#13e5566e4d780618ba52bd55e0dc713d7a687e59" + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.2.tgz#00cbf48563f377f9ce5cf24237b21b3d9779e055" dependencies: "@types/node" "*" @@ -17,12 +17,12 @@ resolved "https://registry.yarnpkg.com/@types/jest/-/jest-19.2.3.tgz#61748040e8589a891dfc2ec1d16a2dd74482980e" "@types/node@*", "@types/node@latest": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + version "7.0.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.22.tgz#4593f4d828bdd612929478ea40c67b4f403ca255" "@types/react@latest": - version "15.0.24" - resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.24.tgz#8a75299dc37906df327c18ca918bf97a55e7123b" + version "15.0.25" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.25.tgz#d396949cccc9a90b61755def9781e5aced9b2261" "@types/source-map-support@latest": version "0.2.28" @@ -34,10 +34,6 @@ abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" -abbrev@1, abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - acorn-globals@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" @@ -45,8 +41,8 @@ acorn-globals@^3.1.0: acorn "^4.0.4" acorn@^4.0.4: - version "4.0.11" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" ajv@^4.9.1: version "4.11.8" @@ -63,7 +59,7 @@ align-text@^0.1.1, align-text@^0.1.3: longest "^1.0.1" repeat-string "^1.5.2" -amdefine@>=0.0.4, amdefine@^1.0.0: +amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -77,7 +73,7 @@ ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-regex@^2.0.0: +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -120,22 +116,10 @@ arr-flatten@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" - array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - -array-uniq@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -160,13 +144,13 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -async@1.x, async@^1.4.0: +async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.4.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + version "2.4.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" dependencies: lodash "^4.14.0" @@ -234,21 +218,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" - dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^19.0.0" - -babel-jest@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.0.tgz#05ae371102ee8e30c9d61ffdf3f61c738a87741f" +babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^20.0.0" + babel-preset-jest "^20.0.3" babel-messages@^6.23.0: version "6.23.0" @@ -264,10 +240,6 @@ babel-plugin-istanbul@^4.0.0, babel-plugin-istanbul@^4.1.4: istanbul-lib-instrument "^1.7.2" test-exclude "^4.1.1" -babel-plugin-jest-hoist@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" - babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" @@ -288,13 +260,7 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-preset-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" - dependencies: - babel-plugin-jest-hoist "^19.0.0" - -babel-preset-jest@^20.0.0, babel-preset-jest@^20.0.3: +babel-preset-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" dependencies: @@ -353,8 +319,8 @@ babel-types@^6.18.0, babel-types@^6.24.1: to-fast-properties "^1.0.1" babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + version "6.17.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f" bail@^1.0.0: version "1.0.1" @@ -370,10 +336,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -384,7 +346,7 @@ boundary@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/boundary/-/boundary-1.0.1.tgz#4d67dc2602c0cc16dd9bce7ebf87e948290f5812" -brace-expansion@^1.0.0: +brace-expansion@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" dependencies: @@ -417,6 +379,10 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -425,21 +391,10 @@ callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" @@ -463,7 +418,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.1.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -509,14 +464,6 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" -clone-stats@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - -clone@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -611,32 +558,19 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - dependencies: - array-find-index "^1.0.1" - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" dependencies: assert-plus "^1.0.0" -dateformat@^1.0.11: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.3: - version "2.6.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: - ms "0.7.3" + ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -660,7 +594,7 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@^3.0.0, diff@^3.0.1, diff@^3.2.0: +diff@^3.0.1, diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -691,24 +625,18 @@ domelementtype@~1.1.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" domhandler@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + version "2.4.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259" dependencies: domelementtype "1" domutils@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.0.tgz#853de07f013287f976b7fe0461740222ea14ecbb" + version "1.6.2" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.2.tgz#1958cc0b4c9426e9ed367fb1c8e854891b0fa3ff" dependencies: dom-serializer "0" domelementtype "1" -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - dependencies: - readable-stream "~1.1.9" - duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -749,7 +677,7 @@ escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escodegen@1.8.x, escodegen@^1.6.1: +escodegen@^1.6.1: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" dependencies: @@ -760,7 +688,7 @@ escodegen@1.8.x, escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -esprima@2.7.x, esprima@^2.7.1: +esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -832,13 +760,6 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" -fancy-log@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" - dependencies: - chalk "^1.1.1" - time-stamp "^1.0.0" - fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -933,13 +854,6 @@ from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" -fs-extra@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - fs-extra@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" @@ -960,10 +874,6 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" @@ -977,13 +887,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-all@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab" - dependencies: - glob "^7.0.5" - yargs "~1.2.6" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -997,24 +900,24 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^5.0.15, glob@~5.0.0: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" +glob@~5.0.0: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" dependencies: - fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.2" + minimatch "2 || 3" once "^1.3.0" path-is-absolute "^1.0.0" @@ -1022,12 +925,6 @@ globals@^9.0.0: version "9.17.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" -glogg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" - dependencies: - sparkles "^1.0.0" - graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -1036,38 +933,9 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -gulp-util@3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^1.0.11" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - dependencies: - glogg "^1.0.0" - -handlebars@^4.0.1, handlebars@^4.0.3: - version "4.0.8" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.8.tgz#22b875cd3f0e6cbea30314f144e82bc7a72ff420" +handlebars@^4.0.3: + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" dependencies: async "^1.4.0" optimist "^0.6.1" @@ -1096,12 +964,6 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - dependencies: - sparkles "^1.0.0" - has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -1161,12 +1023,6 @@ iconv-lite@0.4.13, iconv-lite@~0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1293,10 +1149,6 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1323,32 +1175,32 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" istanbul-api@^1.1.1: - version "1.1.8" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + version "1.1.9" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.9.tgz#2827920d380d4286d857d57a2968a841db8a7ec8" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.0" - istanbul-lib-hook "^1.0.6" - istanbul-lib-instrument "^1.7.1" - istanbul-lib-report "^1.1.0" - istanbul-lib-source-maps "^1.2.0" - istanbul-reports "^1.1.0" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.0.7" + istanbul-lib-instrument "^1.7.2" + istanbul-lib-report "^1.1.1" + istanbul-lib-source-maps "^1.2.1" + istanbul-reports "^1.1.1" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0, istanbul-lib-coverage@^1.1.1: +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" -istanbul-lib-hook@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" +istanbul-lib-hook@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1, istanbul-lib-instrument@^1.7.2: +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" dependencies: @@ -1360,57 +1212,38 @@ istanbul-lib-instrument@^1.2.0, istanbul-lib-instrument@^1.4.2, istanbul-lib-ins istanbul-lib-coverage "^1.1.1" semver "^5.3.0" -istanbul-lib-report@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" +istanbul-lib-report@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" dependencies: - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" dependencies: debug "^2.6.3" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" +istanbul-reports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" dependencies: handlebars "^4.0.3" -istanbul@0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -jest-changed-files@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.0.tgz#2ad82870a815b40ce3f4bf4555581d387b21022c" - -jest-cli@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.0.tgz#72664e0723bd099a0bade5bd4bf960fd54876069" +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" + +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" @@ -1421,18 +1254,18 @@ jest-cli@^20.0.0: istanbul-lib-coverage "^1.0.1" istanbul-lib-instrument "^1.4.2" istanbul-lib-source-maps "^1.1.0" - jest-changed-files "^20.0.0" - jest-config "^20.0.0" - jest-docblock "^20.0.0" - jest-environment-jsdom "^20.0.0" - jest-haste-map "^20.0.0" - jest-jasmine2 "^20.0.0" - jest-message-util "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve-dependencies "^20.0.0" - jest-runtime "^20.0.0" - jest-snapshot "^20.0.0" - jest-util "^20.0.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" micromatch "^2.3.11" node-notifier "^5.0.2" pify "^2.3.0" @@ -1443,310 +1276,177 @@ jest-cli@^20.0.0: worker-farm "^1.3.1" yargs "^7.0.2" -jest-config@^19.0.0: - version "19.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" - dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^19.0.2" - jest-environment-node "^19.0.2" - jest-jasmine2 "^19.0.2" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.2" - jest-validate "^19.0.2" - pretty-format "^19.0.0" - -jest-config@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.0.tgz#295fe937a377f79a8eea240ad29546bf43acbbec" +jest-config@^20.0.0, jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" dependencies: chalk "^1.1.3" glob "^7.1.1" - jest-environment-jsdom "^20.0.0" - jest-environment-node "^20.0.0" - jest-jasmine2 "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve "^20.0.0" - jest-validate "^20.0.0" - pretty-format "^20.0.0" - -jest-diff@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" - dependencies: - chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^19.0.0" - pretty-format "^19.0.0" - -jest-diff@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.0.tgz#d6e9190b57e0333c6706ef28d62b1cb23042d7eb" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" dependencies: chalk "^1.1.3" diff "^3.2.0" - jest-matcher-utils "^20.0.0" - pretty-format "^20.0.0" - -jest-docblock@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.0.tgz#5b647c4af36f52dae74df1949a8cb418d146ad3a" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" -jest-environment-jsdom@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" - jsdom "^9.11.0" +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" -jest-environment-jsdom@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.0.tgz#a688499d817e33cdea6400c502d8d5f4aa01c808" +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" dependencies: - jest-mock "^20.0.0" - jest-util "^20.0.0" + jest-mock "^20.0.3" + jest-util "^20.0.3" jsdom "^9.12.0" -jest-environment-node@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" - -jest-environment-node@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.0.tgz#7016d8d1270cbc1ed71a10f242c78324297e1db8" - dependencies: - jest-mock "^20.0.0" - jest-util "^20.0.0" - -jest-file-exists@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" - -jest-haste-map@^19.0.0: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" dependencies: - fb-watchman "^2.0.0" - graceful-fs "^4.1.6" - micromatch "^2.3.11" - sane "~1.5.0" - worker-farm "^1.3.1" + jest-mock "^20.0.3" + jest-util "^20.0.3" -jest-haste-map@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.0.tgz#3b8d9255dfe2a6a96e516fe71dafd415e1b5d65f" +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^20.0.0" + jest-docblock "^20.0.3" micromatch "^2.3.11" sane "~1.6.0" worker-farm "^1.3.1" -jest-jasmine2@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" - dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^19.0.0" - jest-matchers "^19.0.0" - jest-message-util "^19.0.0" - jest-snapshot "^19.0.2" - -jest-jasmine2@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.0.tgz#2a0aba92ed36ec132901cfc2a552fd7cee6fde3d" +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" dependencies: chalk "^1.1.3" graceful-fs "^4.1.11" - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-matchers "^20.0.0" - jest-message-util "^20.0.0" - jest-snapshot "^20.0.0" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" once "^1.4.0" p-map "^1.1.1" -jest-matcher-utils@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" - dependencies: - chalk "^1.1.3" - pretty-format "^19.0.0" - -jest-matcher-utils@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.0.tgz#2c5d9dd11670c5418ffc78baecf9094db9e91e09" +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" dependencies: chalk "^1.1.3" - pretty-format "^20.0.0" + pretty-format "^20.0.3" -jest-matchers@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" - dependencies: - jest-diff "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" - -jest-matchers@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.0.tgz#55498637bbb58f164d97c73610fb8d016dfac770" - dependencies: - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-message-util "^20.0.0" - jest-regex-util "^20.0.0" - -jest-message-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" dependencies: - chalk "^1.1.1" - micromatch "^2.3.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" -jest-message-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.0.tgz#060bac1980bd5e11134e8e1c19c94863d937c727" +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" dependencies: chalk "^1.1.3" micromatch "^2.3.11" slash "^1.0.0" -jest-mock@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" - -jest-mock@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.0.tgz#3c54b94fe502ed57f2e602fab22ab196a7aa4b95" - -jest-regex-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" - -jest-regex-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.0.tgz#7f6051e9d00fdcccca52bade50aabdd9919bcfd2" +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" -jest-resolve-dependencies@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.0.tgz#616c6976c52e49d13e6420b1bcc8f380e701408f" - dependencies: - jest-regex-util "^20.0.0" +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" -jest-resolve@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" dependencies: - browser-resolve "^1.11.2" - jest-haste-map "^19.0.0" - resolve "^1.2.0" + jest-regex-util "^20.0.3" -jest-resolve@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.0.tgz#f9bfdfa31109aee2decfc3a07c2c354608cc5e1d" +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" dependencies: browser-resolve "^1.11.2" is-builtin-module "^1.0.0" resolve "^1.3.2" -jest-runtime@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.0.tgz#4c78c08573ffaeba9b8ceb096f705b75d5fb54a1" +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" dependencies: babel-core "^6.0.0" - babel-jest "^20.0.0" + babel-jest "^20.0.3" babel-plugin-istanbul "^4.0.0" chalk "^1.1.3" convert-source-map "^1.4.0" graceful-fs "^4.1.11" - jest-config "^20.0.0" - jest-haste-map "^20.0.0" - jest-regex-util "^20.0.0" - jest-resolve "^20.0.0" - jest-util "^20.0.0" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" json-stable-stringify "^1.0.1" micromatch "^2.3.11" strip-bom "3.0.0" yargs "^7.0.2" -jest-snapshot@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" - dependencies: - chalk "^1.1.3" - jest-diff "^19.0.0" - jest-file-exists "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-util "^19.0.2" - natural-compare "^1.4.0" - pretty-format "^19.0.0" - -jest-snapshot@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.0.tgz#fbe51d94ed1c6cd23808bb7ef82e58ca12a0ccf7" +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" dependencies: chalk "^1.1.3" - jest-diff "^20.0.0" - jest-matcher-utils "^20.0.0" - jest-util "^20.0.0" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" natural-compare "^1.4.0" - pretty-format "^20.0.0" - -jest-util@^19.0.0, jest-util@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" - dependencies: - chalk "^1.1.1" - graceful-fs "^4.1.6" - jest-file-exists "^19.0.0" - jest-message-util "^19.0.0" - jest-mock "^19.0.0" - jest-validate "^19.0.2" - leven "^2.0.0" - mkdirp "^0.5.1" + pretty-format "^20.0.3" -jest-util@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.0.tgz#5421322f196e884e962bc8b8bac4b009733caed9" +jest-util@^20.0.0, jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" dependencies: chalk "^1.1.3" graceful-fs "^4.1.11" - jest-message-util "^20.0.0" - jest-mock "^20.0.0" - jest-validate "^20.0.0" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" leven "^2.1.0" mkdirp "^0.5.1" -jest-validate@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" - dependencies: - chalk "^1.1.1" - jest-matcher-utils "^19.0.0" - leven "^2.0.0" - pretty-format "^19.0.0" - -jest-validate@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.0.tgz#c0832e8210190b6d5b39a46b8df536083131a7d7" +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" dependencies: chalk "^1.1.3" - jest-matcher-utils "^20.0.0" + jest-matcher-utils "^20.0.3" leven "^2.1.0" - pretty-format "^20.0.0" + pretty-format "^20.0.3" jest@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.0.tgz#58cf6abf328f2a2e3c4203890131cbe89d3b0769" + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" dependencies: - jest-cli "^20.0.0" + jest-cli "^20.0.4" jodid25519@^1.0.0: version "1.0.2" @@ -1758,9 +1458,9 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@3.x, js-yaml@^3.7.0: - version "3.8.3" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" +js-yaml@^3.7.0: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" @@ -1769,7 +1469,7 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^9.11.0, jsdom@^9.12.0: +jsdom@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" dependencies: @@ -1815,12 +1515,6 @@ json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" @@ -1841,8 +1535,8 @@ jsprim@^1.2.2: verror "1.3.6" kind-of@^3.0.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07" + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" dependencies: is-buffer "^1.1.5" @@ -1856,7 +1550,7 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -leven@^2.0.0, leven@^2.1.0: +leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -1893,105 +1587,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - -lodash.assign@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - dependencies: - lodash._root "^3.0.0" - -lodash.includes@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.partition@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.partition/-/lodash.partition-4.6.0.tgz#a38e46b73469e0420b0da1212e66d414be364ba4" - -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash@^4.14.0, lodash@^4.2.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2004,19 +1599,12 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" @@ -2030,10 +1618,6 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" @@ -2057,21 +1641,6 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -meow@^3.3.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" @@ -2108,47 +1677,37 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" - -minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@~1.2.0: +minimist@^1.1.1, minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@0.5.x, mkdirp@^0.5.1: +mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" - -multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - dependencies: - duplexer2 "0.0.2" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" node-fetch@^1.0.1: - version "1.6.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" + version "1.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.0.tgz#3ff6c56544f9b7fb00682338bb55ee6f54a8a0ef" dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -2166,13 +1725,7 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - dependencies: - abbrev "1" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.3.2: version "2.3.8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" dependencies: @@ -2198,17 +1751,13 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.3.9" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" + version "1.4.0" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2220,7 +1769,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@1.x, once@^1.3.0, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2389,16 +1938,11 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" - dependencies: - ansi-styles "^3.0.0" - -pretty-format@^20.0.0: - version "20.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.0.tgz#bd100f330e707e4f49fef3f234d6e915242a6e7e" +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" dependencies: + ansi-regex "^2.1.1" ansi-styles "^3.0.0" private@^0.1.6: @@ -2416,10 +1960,11 @@ promise@^7.1.1: asap "~2.0.3" prop-types@^15.5.7: - version "15.5.8" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + version "15.5.10" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: fbjs "^0.8.9" + loose-envify "^1.3.1" prr@~0.0.0: version "0.0.0" @@ -2496,33 +2041,18 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.2, readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" +readable-stream@^2.0.2: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" dependencies: + buffer-shims "~1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" process-nextick-args "~1.0.6" - string_decoder "~0.10.x" + string_decoder "~1.0.0" util-deprecate "~1.0.1" -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - regenerator-runtime@^0.10.0: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" @@ -2534,17 +2064,6 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" -remap-istanbul@^0.9.5: - version "0.9.5" - resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.9.5.tgz#a18617b1f31eec5a7dbee77538298b775606aaa8" - dependencies: - amdefine "^1.0.0" - gulp-util "3.0.7" - istanbul "0.4.5" - minimatch "^3.0.3" - source-map ">=0.5.6" - through2 "2.0.1" - remark-parse@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-1.1.0.tgz#c3ca10f9a8da04615c28f09aa4e304510526ec21" @@ -2598,10 +2117,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - request@^2.79.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -2637,11 +2152,11 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -resolve@1.1.7, resolve@1.1.x: +resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.2: +resolve@^1.1.7, resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -2663,18 +2178,6 @@ safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" -sane@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" - dependencies: - anymatch "^1.3.0" - exec-sh "^0.2.0" - fb-watchman "^1.8.0" - minimatch "^3.0.2" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.10.0" - sane@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" @@ -2737,26 +2240,22 @@ source-map-support@^0.4.2, source-map-support@^0.4.4: dependencies: source-map "^0.5.6" -source-map@>=0.5.6, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" dependencies: amdefine ">=0.0.4" -sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -2823,9 +2322,11 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" + dependencies: + safe-buffer "^5.0.1" stringify-entities@^1.0.1: version "1.3.0" @@ -2861,12 +2362,6 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - dependencies: - get-stdin "^4.0.1" - strip-json-comments@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2881,7 +2376,7 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0, supports-color@^3.1.2: +supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -2905,21 +2400,10 @@ throat@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" -through2@2.0.1, through2@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9" - dependencies: - readable-stream "~2.0.0" - xtend "~4.0.0" - through@2, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -time-stamp@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" - tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -2942,10 +2426,6 @@ traverse@^0.6.6: version "0.6.6" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -2963,24 +2443,20 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" ts-jest@latest: - version "19.0.14" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-19.0.14.tgz#88674b956e048f61b0ab28d421bfdabbb641be5c" + version "20.0.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.5.tgz#6cb151e718e8739529d0a79459e09f7280fe044f" dependencies: - babel-jest "^19.0.0" + babel-core "^6.24.1" + babel-plugin-istanbul "^4.1.4" babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - fs-extra "^2.1.2" - glob-all "^3.1.0" - istanbul-lib-instrument "^1.2.0" - jest-config "^19.0.0" - jest-util "^19.0.0" - lodash.assign "^4.2.0" - lodash.includes "^4.3.0" - lodash.partition "^4.6.0" - lodash.pickby "^4.6.0" - remap-istanbul "^0.9.5" + babel-preset-jest "^20.0.3" + fs-extra "^3.0.0" + jest-config "^20.0.0" + jest-util "^20.0.0" + pkg-dir "^2.0.0" source-map-support "^0.4.4" tsconfig "^6.0.0" - yargs "^7.0.2" + yargs "^8.0.1" tsconfig@^6.0.0: version "6.0.0" @@ -3003,8 +2479,8 @@ tslint@next: tsutils "^1.1.0" tsutils@^1.1.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.8.0.tgz#bf8118ed8e80cd5c9fc7d75728c7963d44ed2f52" + version "1.9.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" tunnel-agent@^0.6.0: version "0.6.0" @@ -3023,16 +2499,16 @@ type-check@~0.3.2: prelude-ls "~1.1.2" typescript@latest: - version "2.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" + version "2.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.3.tgz#9639f3c3b40148e8ca97fe08a51dd1891bb6be22" ua-parser-js@^0.7.9: version "0.7.12" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" uglify-js@^2.6: - version "2.8.22" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + version "2.8.27" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c" dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -3112,14 +2588,6 @@ vfile@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/vfile/-/vfile-1.4.0.tgz#c0fd6fa484f8debdb771f68c31ed75d88da97fe7" -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" @@ -3149,8 +2617,8 @@ whatwg-fetch@>=0.10.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" whatwg-url@^4.3.0: - version "4.7.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -3163,7 +2631,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.1.1, which@^1.2.12, which@^1.2.9: +which@^1.2.12, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -3177,14 +2645,14 @@ wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + worker-farm@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" @@ -3207,7 +2675,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1, xtend@~4.0.0: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -3267,12 +2735,6 @@ yargs@^8.0.1: y18n "^3.2.1" yargs-parser "^7.0.0" -yargs@~1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b" - dependencies: - minimist "^0.1.0" - yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From 5de92d06317820ecfb2b495ffe65f5aaa312a413 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 30 May 2017 12:59:53 +0200 Subject: [PATCH 181/256] new babel regression test --- .../regression-tests.spec.ts.snap | 70 +++++++++++++++++++ tests/__tests__/regression-tests.spec.ts | 28 ++++++++ 2 files changed, 98 insertions(+) diff --git a/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap b/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap index 330b996361..093f7ea334 100644 --- a/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap +++ b/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap @@ -1,5 +1,75 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Process regession tests Should not change the output of a process that has skipBabel set to true 1`] = ` +"'use strict';require('ts-jest').install();\\"use strict\\"; +var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}} + function rejected(value) {try {step(generator[\\"throw\\"](value));} catch (e) {reject(e);}} + function step(result) {result.done ? resolve(result.value) : new P(function (resolve) {resolve(result.value);}).then(fulfilled, rejected);} + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = undefined && undefined.__generator || function (thisArg, body) { + var _ = { label: 0, sent: function () {if (t[0] & 1) throw t[1];return t[1];}, trys: [], ops: [] },f,y,t,g; + return g = { next: verb(0), \\"throw\\": verb(1), \\"return\\": verb(2) }, typeof Symbol === \\"function\\" && (g[Symbol.iterator] = function () {return this;}), g; + function verb(n) {return function (v) {return step([n, v]);};} + function step(op) { + if (f) throw new TypeError(\\"Generator is already executing.\\"); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? \\"return\\" : op[0] ? \\"throw\\" : \\"next\\"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0:case 1:t = op;break; + case 4:_.label++;return { value: op[1], done: false }; + case 5:_.label++;y = op[1];op = [0];continue; + case 7:op = _.ops.pop();_.trys.pop();continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {_ = 0;continue;} + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;} + if (op[0] === 6 && _.label < t[1]) {_.label = t[1];t = op;break;} + if (t && _.label < t[2]) {_.label = t[2];_.ops.push(op);break;} + if (t[2]) _.ops.pop(); + _.trys.pop();continue;} + + op = body.call(thisArg, _); + } catch (e) {op = [6, e];y = 0;} finally {f = t = 0;} + if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = undefined; +exports.__esModule = true; +var module_1 = require(\\"../module\\"); +require(\\"jest\\"); +describe('the module which has no default export', function () { + it('should return sensible values when trying to access its exports', function () { + expect(module_1[\\"default\\"].someExport).toBe('someExport'); + }); +}); +function noop() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, Promise.resolve('noop')]; + }); + }); +} +describe('async-await stuff', function () { + it('should be compiled by TS not Babel', function (done) {return __awaiter(_this, void 0, void 0, function () { + var g; + return __generator(this, function (_a) { + switch (_a.label) { + case 0:return [4 /*yield*/, noop()]; + case 1: + g = _a.sent(); + expect(g).toBe('noop'); + done(); + return [2 /*return*/];} + + }); + });}); +});" +`; + exports[`Process regession tests Should not change the output of process that compiles .ts files 1`] = ` "'use strict';require('ts-jest').install();\\"use strict\\"; exports.__esModule = true; diff --git a/tests/__tests__/regression-tests.spec.ts b/tests/__tests__/regression-tests.spec.ts index f3b0514f03..55529bc75c 100644 --- a/tests/__tests__/regression-tests.spec.ts +++ b/tests/__tests__/regression-tests.spec.ts @@ -22,7 +22,24 @@ const allowSyntheticDefaultImportsConfig = { } }; +const skipBabelConfig = { + cacheDirectory: + '/tmp/cacheStuff', + globals: { + __TS_CONFIG__: { + allowSyntheticDefaultImports: true, + jsx: 'react', + }, + 'ts-jest': + { + skipBabel: true, + } + } +}; + describe('Process regession tests', () => { + //These tests are to make that we only intentionally change the output of process. + it('Should not change the output of process that compiles .ts files', () => { const src = fs.readFileSync('./tests/simple/Hello.ts', 'utf-8'); const path = './tests/simple/Hello.ts'; @@ -56,5 +73,16 @@ describe('Process regession tests', () => { expect(outcome).toMatchSnapshot(); }); + it('Should not change the output of process that contains hoist calls', () => { + //TODO + }); + + it('Should not change the output of a process that has skipBabel set to true', () => { + const src = fs.readFileSync('./tests/synthetic-default/__tests__/module.test.ts', 'utf-8'); + const path = './tests/synthetic-default/__tests__/module.test.ts'; + const outcome = process(src, path, skipBabelConfig); + + expect(outcome).toMatchSnapshot(); + }); }); \ No newline at end of file From 666c90e252197452ae4029db376b421bff81e737 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 30 May 2017 13:11:15 +0200 Subject: [PATCH 182/256] uses babeltransformer always. Breaks sourcemaps --- src/postprocess.ts | 5 ++++- tests/__tests__/regression-tests.spec.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index 7cc9f001d9..59c24b36a5 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -53,5 +53,8 @@ export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfi plugins: plugins, }); } - return (src) => src; //Identity function + return createBabelTransformer({ + presets: [], + plugins: [], + }); }; diff --git a/tests/__tests__/regression-tests.spec.ts b/tests/__tests__/regression-tests.spec.ts index 55529bc75c..790b6c3a7b 100644 --- a/tests/__tests__/regression-tests.spec.ts +++ b/tests/__tests__/regression-tests.spec.ts @@ -6,7 +6,7 @@ const globalConfig = { '/tmp/cacheStuff', globals: { __TS_CONFIG__: { - + jsx: 'react', } } }; From 2f73146d29915b528020f6d363d7e63520b0800f Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Tue, 30 May 2017 14:19:20 +0200 Subject: [PATCH 183/256] =?UTF-8?q?Updated=20README=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents issue #205 --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index b1187e43c9..19a766f342 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,12 @@ - [Versioning](#versioning) - [Usage](#usage) + - [Coverage](#coverage) + - [React Native](#react-native) - [Options](#options) - [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options) +- [Tips](#tips) + - [Importing packages written in TypeScript](#importing-packages-written-in-typescript) - [How to Contribute](#how-to-contribute) - [Quickstart to run tests (only if you're working on this package)](#quickstart-to-run-tests-only-if-youre-working-on-this-package) - [License](#license) @@ -183,6 +187,27 @@ For all available options see [TypeScript docs](https://www.typescriptlang.org/d } ``` +## Tips + +### Importing packages written in TypeScript + +If you have dependencies on npm packages that are written in TypeScript but are +**not** published in ES5 you have to tweak your configuration. For example +you depend on a private scoped package `@foo/bar` you have to add following to +your Jest configuration: + +```js +{ + // ... + "transformIgnorePatterns": [ + "/node_modules/(?!@foo)" + ] + // ... +} +``` + +This will ignore **all** packages in your scope `@foo`. + ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From 63283fb0027a64e318d75c6842e8cc83e5feebf8 Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Tue, 30 May 2017 14:35:57 +0200 Subject: [PATCH 184/256] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19a766f342..0646586c89 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ your Jest configuration: } ``` -This will ignore **all** packages in your scope `@foo`. +This will ignore everything for transpilation **but** `@foo`. ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From b8fabe414a6c891e64c1c6c28228fc147d6223e7 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 30 May 2017 18:18:18 +0530 Subject: [PATCH 185/256] Improve the note on using transformIgnorePatterns --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0646586c89..bc6ba4e9f0 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ your Jest configuration: } ``` -This will ignore everything for transpilation **but** `@foo`. +By default Jest ignores everything in `node_modules`. This setting prevents Jest from ignoring the package you're interested in, in this case `@foo`, while continuing to ignore everything else in `node_modules`. ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From 479ad3efedb3760f42ea6306813d6664b178dd1e Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 30 May 2017 18:21:11 +0530 Subject: [PATCH 186/256] Update AUTHORS Add @screendriver to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index c6812cca38..cb6ebf343d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,6 +8,7 @@ Andreas Krummsdorf Bartosz Gościński Blake Embrey Chong Guo +Christian Rackerseder Daniel Perez Alvarez David Sheldrick Emil Persson From b79a491a24b2b92a69aff7811bdae085fbfc6208 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:27:36 +0200 Subject: [PATCH 187/256] all tests but hoist pass atm --- src/postprocess.ts | 6 +- tests/__tests__/jest-hoist.spec.ts | 13 +++ tests/__tests__/regression-tests.spec.ts | 88 ------------------- tests/__tests__/ts-compilation.spec.ts | 2 +- tests/__tests__/ts-errors.spec.ts | 11 +++ tests/hoist-test/__tests__/jest-hoist.test.ts | 27 ++++++ tests/hoist-test/package.json | 14 +++ tests/hoist-test/src/things-to-mock.ts | 10 +++ tests/hoist-test/tsconfig.json | 12 +++ tests/simple-async/__tests__/Hello.test.ts | 2 +- tests/simple/__tests__/Hello.test.ts | 2 +- 11 files changed, 94 insertions(+), 93 deletions(-) create mode 100644 tests/__tests__/jest-hoist.spec.ts delete mode 100644 tests/__tests__/regression-tests.spec.ts create mode 100644 tests/hoist-test/__tests__/jest-hoist.test.ts create mode 100644 tests/hoist-test/package.json create mode 100644 tests/hoist-test/src/things-to-mock.ts create mode 100644 tests/hoist-test/tsconfig.json diff --git a/src/postprocess.ts b/src/postprocess.ts index 59c24b36a5..8c066f7d1c 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -53,8 +53,10 @@ export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfi plugins: plugins, }); } - return createBabelTransformer({ + return (src) => src; //Identity function + + /*return createBabelTransformer({ presets: [], plugins: [], - }); + });*/ }; diff --git a/tests/__tests__/jest-hoist.spec.ts b/tests/__tests__/jest-hoist.spec.ts new file mode 100644 index 0000000000..9c2c24c1d2 --- /dev/null +++ b/tests/__tests__/jest-hoist.spec.ts @@ -0,0 +1,13 @@ +import runJest from '../__helpers__/runJest'; + +describe('Jest.mock() calls', () => { + + it('Should run all tests using jest.mock() underneath the imports succesfully.', () => { + const result = runJest('../hoist-test', ['--no-cache']); + const output = result.output.toString(); + + expect(output).toContain('4 passed, 4 total'); + expect(result.status).toBe(0); + }); + +}); diff --git a/tests/__tests__/regression-tests.spec.ts b/tests/__tests__/regression-tests.spec.ts deleted file mode 100644 index 790b6c3a7b..0000000000 --- a/tests/__tests__/regression-tests.spec.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { process } from '../../src/preprocessor'; -import * as fs from 'fs'; - -const globalConfig = { - cacheDirectory: - '/tmp/cacheStuff', - globals: { - __TS_CONFIG__: { - jsx: 'react', - } - } -}; - -const allowSyntheticDefaultImportsConfig = { - cacheDirectory: - '/tmp/cacheStuff', - globals: { - __TS_CONFIG__: { - allowSyntheticDefaultImports: true, - jsx: 'react', - } - } -}; - -const skipBabelConfig = { - cacheDirectory: - '/tmp/cacheStuff', - globals: { - __TS_CONFIG__: { - allowSyntheticDefaultImports: true, - jsx: 'react', - }, - 'ts-jest': - { - skipBabel: true, - } - } -}; - -describe('Process regession tests', () => { - //These tests are to make that we only intentionally change the output of process. - - it('Should not change the output of process that compiles .ts files', () => { - const src = fs.readFileSync('./tests/simple/Hello.ts', 'utf-8'); - const path = './tests/simple/Hello.ts'; - const outcome = process(src, path, globalConfig); - - expect(outcome).toMatchSnapshot(); - }); - - it('Should not change the output of process that compiles .tsx files', () => { - const src = fs.readFileSync('./tests/button/Button.tsx', 'utf-8'); - const path = './tests/simple/Button.tsx'; - const outcome = process(src, path, globalConfig); - - expect(outcome).toMatchSnapshot(); - }); - - it('Should not change the output of process that compiles .ts files with syntheticdefaultimport', () => { - const src = fs.readFileSync('./tests/synthetic-default/__tests__/module.test.ts', 'utf-8'); - const path = './tests/synthetic-default/__tests__/module.test.ts'; - const outcome = process(src, path, allowSyntheticDefaultImportsConfig); - - expect(outcome).toMatchSnapshot(); - }); - - - it('Should not change the output of process that compiles .tsx files with syntheticdefaultimport', () => { - const src = fs.readFileSync('./tests/button/Button.tsx', 'utf-8'); - const path = './tests/button/Button.tsx'; - const outcome = process(src, path, allowSyntheticDefaultImportsConfig); - - expect(outcome).toMatchSnapshot(); - }); - - it('Should not change the output of process that contains hoist calls', () => { - //TODO - }); - - it('Should not change the output of a process that has skipBabel set to true', () => { - const src = fs.readFileSync('./tests/synthetic-default/__tests__/module.test.ts', 'utf-8'); - const path = './tests/synthetic-default/__tests__/module.test.ts'; - const outcome = process(src, path, skipBabelConfig); - - expect(outcome).toMatchSnapshot(); - }); - -}); \ No newline at end of file diff --git a/tests/__tests__/ts-compilation.spec.ts b/tests/__tests__/ts-compilation.spec.ts index 30af1d2b05..3c683c4ca8 100644 --- a/tests/__tests__/ts-compilation.spec.ts +++ b/tests/__tests__/ts-compilation.spec.ts @@ -12,7 +12,7 @@ describe('TS Compilation', () => { expect(result.status).toBe(1); expect(output).toContain('1 failed, 1 total'); expect(stderr).toContain('Hello Class'); - expect(stderr).toContain('should throw an error on line 11'); + expect(stderr).toContain('should throw an error on line 13'); }); diff --git a/tests/__tests__/ts-errors.spec.ts b/tests/__tests__/ts-errors.spec.ts index 74e5a34a3a..ecc2c2bcb9 100644 --- a/tests/__tests__/ts-errors.spec.ts +++ b/tests/__tests__/ts-errors.spec.ts @@ -14,4 +14,15 @@ describe('Typescript errors', () => { }); + it('Should show the correct error locations in async typescript files', async () => { + const result = runJest('../simple-async', ['--no-cache']); + + const stderr = result.stderr.toString(); + + expect(result.status).toBe(1); + expect(stderr).toContain('Hello.ts:13:11'); + expect(stderr).toContain('Hello.test.ts:9:21'); + }); + + }); \ No newline at end of file diff --git a/tests/hoist-test/__tests__/jest-hoist.test.ts b/tests/hoist-test/__tests__/jest-hoist.test.ts new file mode 100644 index 0000000000..c773fa7991 --- /dev/null +++ b/tests/hoist-test/__tests__/jest-hoist.test.ts @@ -0,0 +1,27 @@ + +import * as path from 'path'; +import {SomeClass, SomeFunctionDeclaredAsConst, SomeFunction} from '../src/things-to-mock'; + +jest.mock('../src/things-to-mock'); +jest.mock('path'); + + +describe('Global mocks', () => { + it('A global var should be mocked when the jest.mock call is underneath', () => { + expect((path.basename as any).mock).toBeDefined(); + }); +}); + +describe('Local mocks', () => { + it('Jest should be able to mock a local class', () => { + expect((SomeClass as any).mockReturnValue).toBeDefined(); + }); + + it('Jest should be able to mock a local class', () => { + expect((SomeFunction as any).mockReturnValueOnce).toBeDefined(); + }); + + it('Jest should be able to mock a local class', () => { + expect((SomeFunctionDeclaredAsConst as any).mockImplementation).toBeDefined(); + }); +}); diff --git a/tests/hoist-test/package.json b/tests/hoist-test/package.json new file mode 100644 index 0000000000..a4585ceb21 --- /dev/null +++ b/tests/hoist-test/package.json @@ -0,0 +1,14 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "moduleDirectories": ["node_modules", "src"], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} \ No newline at end of file diff --git a/tests/hoist-test/src/things-to-mock.ts b/tests/hoist-test/src/things-to-mock.ts new file mode 100644 index 0000000000..b5a1a251e0 --- /dev/null +++ b/tests/hoist-test/src/things-to-mock.ts @@ -0,0 +1,10 @@ + + +export class SomeClass { +} + +export const SomeFunctionDeclaredAsConst = () => 'originalValue'; + +export function SomeFunction(){ + return 'original'; +} \ No newline at end of file diff --git a/tests/hoist-test/tsconfig.json b/tests/hoist-test/tsconfig.json new file mode 100644 index 0000000000..e2b8966352 --- /dev/null +++ b/tests/hoist-test/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true, + "baseUrl": "src", + "allowSyntheticDefaultImports": false + } +} \ No newline at end of file diff --git a/tests/simple-async/__tests__/Hello.test.ts b/tests/simple-async/__tests__/Hello.test.ts index c5e07503ce..9c6544edb8 100644 --- a/tests/simple-async/__tests__/Hello.test.ts +++ b/tests/simple-async/__tests__/Hello.test.ts @@ -4,7 +4,7 @@ import { Hello } from '../Hello'; describe('Hello Class', () => { - it('should throw an error on line 11', () => { + it('should throw an error on line 13', () => { return new Promise((resolve: () => void) => { const hello = new Hello(); resolve(); diff --git a/tests/simple/__tests__/Hello.test.ts b/tests/simple/__tests__/Hello.test.ts index e3038e335e..e38144b4cd 100644 --- a/tests/simple/__tests__/Hello.test.ts +++ b/tests/simple/__tests__/Hello.test.ts @@ -4,7 +4,7 @@ import { Hello } from '../Hello'; describe('Hello Class', () => { - it('should throw an error on line 11', () => { + it('should throw an error on line 13', () => { const hello = new Hello(); From b26a94913183370c37acd3d187583594633ff5fe Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:34:21 +0200 Subject: [PATCH 188/256] all tests pass now --- src/postprocess.ts | 91 ++++--- .../regression-tests.spec.ts.snap | 246 ------------------ tests/__tests__/tsx-errors.spec.ts | 2 +- 3 files changed, 45 insertions(+), 294 deletions(-) delete mode 100644 tests/__tests__/__snapshots__/regression-tests.spec.ts.snap diff --git a/src/postprocess.ts b/src/postprocess.ts index 8c066f7d1c..81dc1a91a4 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -3,60 +3,57 @@ * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js */ import * as jestPreset from 'babel-preset-jest'; -import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; +import {JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions} from './jest-types'; import * as babel from 'babel-core'; -import { CompilerOptions } from 'typescript/lib/typescript'; +import {CompilerOptions} from 'typescript/lib/typescript'; function createBabelTransformer(options: PostProcessorOptions) { - options = { - ...options, - plugins: (options && options.plugins) || [], - presets: ((options && options.presets) || []).concat([jestPreset]), - retainLines: true, - }; - delete options.cacheDirectory; - delete options.filename; + options = { + ...options, + plugins: (options && options.plugins) || [], + presets: ((options && options.presets) || []).concat([jestPreset]), + retainLines: true, + }; + delete options.cacheDirectory; + delete options.filename; - return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({ filename }, options); - if (transformOptions && transformOptions.instrument) { - theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; - // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - require('babel-plugin-istanbul').default, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); - } - return babel.transform(src, theseOptions).code; - }; + return (src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; + }; } export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { - if (tsJestConfig.skipBabel) { - return (src) => src; //Identity function - } + if (tsJestConfig.skipBabel) { + return (src) => src; //Identity function + } - //If we're not skipping babel - if (tsCompilerOptions.allowSyntheticDefaultImports) { - const plugins = ['transform-es2015-modules-commonjs']; - return createBabelTransformer({ - presets: [], - plugins: plugins, - }); - } - return (src) => src; //Identity function + const plugins = []; + //If we're not skipping babel + if (tsCompilerOptions.allowSyntheticDefaultImports) { + plugins.push('transform-es2015-modules-commonjs'); + } - /*return createBabelTransformer({ - presets: [], - plugins: [], - });*/ + + return createBabelTransformer({ + presets: [], + plugins: plugins, + }); }; diff --git a/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap b/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap deleted file mode 100644 index 093f7ea334..0000000000 --- a/tests/__tests__/__snapshots__/regression-tests.spec.ts.snap +++ /dev/null @@ -1,246 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Process regession tests Should not change the output of a process that has skipBabel set to true 1`] = ` -"'use strict';require('ts-jest').install();\\"use strict\\"; -var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}} - function rejected(value) {try {step(generator[\\"throw\\"](value));} catch (e) {reject(e);}} - function step(result) {result.done ? resolve(result.value) : new P(function (resolve) {resolve(result.value);}).then(fulfilled, rejected);} - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = undefined && undefined.__generator || function (thisArg, body) { - var _ = { label: 0, sent: function () {if (t[0] & 1) throw t[1];return t[1];}, trys: [], ops: [] },f,y,t,g; - return g = { next: verb(0), \\"throw\\": verb(1), \\"return\\": verb(2) }, typeof Symbol === \\"function\\" && (g[Symbol.iterator] = function () {return this;}), g; - function verb(n) {return function (v) {return step([n, v]);};} - function step(op) { - if (f) throw new TypeError(\\"Generator is already executing.\\"); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? \\"return\\" : op[0] ? \\"throw\\" : \\"next\\"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0:case 1:t = op;break; - case 4:_.label++;return { value: op[1], done: false }; - case 5:_.label++;y = op[1];op = [0];continue; - case 7:op = _.ops.pop();_.trys.pop();continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {_ = 0;continue;} - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;} - if (op[0] === 6 && _.label < t[1]) {_.label = t[1];t = op;break;} - if (t && _.label < t[2]) {_.label = t[2];_.ops.push(op);break;} - if (t[2]) _.ops.pop(); - _.trys.pop();continue;} - - op = body.call(thisArg, _); - } catch (e) {op = [6, e];y = 0;} finally {f = t = 0;} - if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var _this = undefined; -exports.__esModule = true; -var module_1 = require(\\"../module\\"); -require(\\"jest\\"); -describe('the module which has no default export', function () { - it('should return sensible values when trying to access its exports', function () { - expect(module_1[\\"default\\"].someExport).toBe('someExport'); - }); -}); -function noop() { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, Promise.resolve('noop')]; - }); - }); -} -describe('async-await stuff', function () { - it('should be compiled by TS not Babel', function (done) {return __awaiter(_this, void 0, void 0, function () { - var g; - return __generator(this, function (_a) { - switch (_a.label) { - case 0:return [4 /*yield*/, noop()]; - case 1: - g = _a.sent(); - expect(g).toBe('noop'); - done(); - return [2 /*return*/];} - - }); - });}); -});" -`; - -exports[`Process regession tests Should not change the output of process that compiles .ts files 1`] = ` -"'use strict';require('ts-jest').install();\\"use strict\\"; -exports.__esModule = true; -var Hello = (function () { - function Hello() { - var greeting = \\"\\\\n this\\\\n is\\\\n a\\\\n multiline\\\\n greeting\\\\n \\"; - this.unexcuted(function () { }); - throw new Error('Hello error!'); - } - Hello.prototype.unexcuted = function (action) { - if (action === void 0) { action = function () { }; } - if (action) { - action(); - } - else { - console.log('unexcuted'); - } - }; - return Hello; -}()); -exports.Hello = Hello; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSGVsbG8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJIZWxsby50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBO0lBQ0U7UUFDRSxJQUFNLFFBQVEsR0FBRyx3RUFNaEIsQ0FBQztRQUVGLElBQUksQ0FBQyxTQUFTLENBQUMsY0FBUSxDQUFDLENBQUMsQ0FBQztRQUUxQixNQUFNLElBQUksS0FBSyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQ2xDLENBQUM7SUFFTSx5QkFBUyxHQUFoQixVQUFpQixNQUE4QjtRQUE5Qix1QkFBQSxFQUFBLHVCQUE2QixDQUFDO1FBQzdDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7WUFDWCxNQUFNLEVBQUUsQ0FBQztRQUNYLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDM0IsQ0FBQztJQUNILENBQUM7SUFDSCxZQUFDO0FBQUQsQ0FBQyxBQXRCRCxJQXNCQztBQXRCWSxzQkFBSyJ9" -`; - -exports[`Process regession tests Should not change the output of process that compiles .ts files with syntheticdefaultimport 1`] = ` -"'use strict';require('ts-jest').install();\\"use strict\\"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var _module = require(\\"../module\\");var _module2 = _interopRequireDefault(_module); -require(\\"jest\\");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {return new (P || (P = Promise))(function (resolve, reject) {function fulfilled(value) {try {step(generator.next(value));} catch (e) {reject(e);}}function rejected(value) {try {step(generator[\\"throw\\"](value));} catch (e) {reject(e);}}function step(result) {result.done ? resolve(result.value) : new P(function (resolve) {resolve(result.value);}).then(fulfilled, rejected);}step((generator = generator.apply(thisArg, _arguments || [])).next());});};var __generator = undefined && undefined.__generator || function (thisArg, body) {var _ = { label: 0, sent: function () {if (t[0] & 1) throw t[1];return t[1];}, trys: [], ops: [] },f,y,t,g;return g = { next: verb(0), \\"throw\\": verb(1), \\"return\\": verb(2) }, typeof Symbol === \\"function\\" && (g[Symbol.iterator] = function () {return this;}), g;function verb(n) {return function (v) {return step([n, v]);};}function step(op) {if (f) throw new TypeError(\\"Generator is already executing.\\");while (_) try {if (f = 1, y && (t = y[op[0] & 2 ? \\"return\\" : op[0] ? \\"throw\\" : \\"next\\"]) && !(t = t.call(y, op[1])).done) return t;if (y = 0, t) op = [0, t.value];switch (op[0]) {case 0:case 1:t = op;break;case 4:_.label++;return { value: op[1], done: false };case 5:_.label++;y = op[1];op = [0];continue;case 7:op = _.ops.pop();_.trys.pop();continue;default:if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {_ = 0;continue;}if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {_.label = op[1];break;}if (op[0] === 6 && _.label < t[1]) {_.label = t[1];t = op;break;}if (t && _.label < t[2]) {_.label = t[2];_.ops.push(op);break;}if (t[2]) _.ops.pop();_.trys.pop();continue;}op = body.call(thisArg, _);} catch (e) {op = [6, e];y = 0;} finally {f = t = 0;}if (op[0] & 5) throw op[1];return { value: op[0] ? op[1] : void 0, done: true };}};var _this = undefined; -describe('the module which has no default export', function () { - it('should return sensible values when trying to access its exports', function () { - expect(_module2.default.someExport).toBe('someExport'); - }); -}); -function noop() { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, Promise.resolve('noop')]; - }); - }); -} -describe('async-await stuff', function () { - it('should be compiled by TS not Babel', function (done) {return __awaiter(_this, void 0, void 0, function () { - var g; - return __generator(this, function (_a) { - switch (_a.label) { - case 0:return [4 /*yield*/, noop()]; - case 1: - g = _a.sent(); - expect(g).toBe('noop'); - done(); - return [2 /*return*/];} - - }); - });}); -});" -`; - -exports[`Process regession tests Should not change the output of process that compiles .tsx files 1`] = ` -"'use strict';require('ts-jest').install();\\"use strict\\"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -var React = require(\\"react\\"); -; -var Button = (function (_super) { - __extends(Button, _super); - function Button() { - return _super !== null && _super.apply(this, arguments) || this; - } - Button.prototype.render = function () { - return (
{this.props.children}
); - }; - return Button; -}(React.Component)); -exports.Button = Button; -var BadButton = (function (_super) { - __extends(BadButton, _super); - function BadButton() { - return _super !== null && _super.apply(this, arguments) || this; - } - BadButton.prototype.render = function () { - \\"\\\\n \\\\n \\"; - if (1 == 1) - throw new Error('Error in Bad button'); - return (
{this.props.children}
); - }; - return BadButton; -}(React.Component)); -exports.BadButton = BadButton; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQnV0dG9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSw2QkFBK0I7QUFFTixDQUFDO0FBRTFCO0lBQTRCLDBCQUFrQztJQUE5RDs7SUFNQSxDQUFDO0lBTEMsdUJBQU0sR0FBTjtRQUNFLE1BQU0sQ0FBQyxDQUNMLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUNwRCxDQUFDO0lBQ0osQ0FBQztJQUNILGFBQUM7QUFBRCxDQUFDLEFBTkQsQ0FBNEIsS0FBSyxDQUFDLFNBQVMsR0FNMUM7QUFOWSx3QkFBTTtBQVFuQjtJQUErQiw2QkFBa0M7SUFBakU7O0lBVUEsQ0FBQztJQVRDLDBCQUFNLEdBQU47UUFDRSxjQUVDLENBQUM7UUFDRixFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO1FBQ25ELE1BQU0sQ0FBQyxDQUNMLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUN4RCxDQUFDO0lBQ0osQ0FBQztJQUNILGdCQUFDO0FBQUQsQ0FBQyxBQVZELENBQStCLEtBQUssQ0FBQyxTQUFTLEdBVTdDO0FBVlksOEJBQVMifQ==" -`; - -exports[`Process regession tests Should not change the output of process that compiles .tsx files with syntheticdefaultimport 1`] = ` -"'use strict';require('ts-jest').install();\\"use strict\\";Object.defineProperty(exports, \\"__esModule\\", { value: true });exports.BadButton = exports.Button = undefined; - - - - - - - - - -var _react = require(\\"react\\");var React = _interopRequireWildcard(_react);function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}}var __extends = undefined && undefined.__extends || function () {var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {d.__proto__ = b;} || function (d, b) {for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];};return function (d, b) {extendStatics(d, b);function __() {this.constructor = d;}d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());};}(); -; -var Button = function (_super) { - __extends(Button, _super); - function Button() { - return _super !== null && _super.apply(this, arguments) || this; - } - Button.prototype.render = function () { - return React.createElement(\\"div\\", { className: \\"button\\" }, this.props.children); - }; - return Button; -}(React.Component);exports. -Button = Button; -var BadButton = function (_super) { - __extends(BadButton, _super); - function BadButton() { - return _super !== null && _super.apply(this, arguments) || this; - } - BadButton.prototype.render = function () { - \\"\\\\n \\\\n \\"; - if (1 == 1) - throw new Error('Error in Bad button'); - return React.createElement(\\"div\\", { className: \\"bad-button\\" }, this.props.children); - }; - return BadButton; -}(React.Component);exports. -BadButton = BadButton;" -`; diff --git a/tests/__tests__/tsx-errors.spec.ts b/tests/__tests__/tsx-errors.spec.ts index 392fcc40fa..f2dfd9c716 100644 --- a/tests/__tests__/tsx-errors.spec.ts +++ b/tests/__tests__/tsx-errors.spec.ts @@ -9,7 +9,7 @@ describe('TSX Errors', () => { const stderr = result.stderr.toString(); expect(result.status).toBe(1); - expect(stderr).toContain('Button.tsx:18:23'); + expect(stderr).toContain('Button.tsx:18:17'); expect(stderr).toContain('Button.test.tsx:15:12'); }); From b1a2224db74dcd3820854ab95b322751fb38a3c6 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:43:13 +0200 Subject: [PATCH 189/256] fixed a few things --- .editorconfig | 6 +++++- tests/__tests__/ts-compilation.spec.ts | 2 +- tests/__tests__/ts-errors.spec.ts | 2 +- tests/simple/Hello.ts | 5 +++++ tests/simple/__tests__/Hello.test.ts | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9541a249ba..a114cc315f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,7 @@ -[*.js] +[*.ts] +indent_style = space +indent_size = 4 + +[*.tsx] indent_style = space indent_size = 4 \ No newline at end of file diff --git a/tests/__tests__/ts-compilation.spec.ts b/tests/__tests__/ts-compilation.spec.ts index 3c683c4ca8..468c302df9 100644 --- a/tests/__tests__/ts-compilation.spec.ts +++ b/tests/__tests__/ts-compilation.spec.ts @@ -12,7 +12,7 @@ describe('TS Compilation', () => { expect(result.status).toBe(1); expect(output).toContain('1 failed, 1 total'); expect(stderr).toContain('Hello Class'); - expect(stderr).toContain('should throw an error on line 13'); + expect(stderr).toContain('should throw an error on line 18'); }); diff --git a/tests/__tests__/ts-errors.spec.ts b/tests/__tests__/ts-errors.spec.ts index ecc2c2bcb9..5a745dc2f9 100644 --- a/tests/__tests__/ts-errors.spec.ts +++ b/tests/__tests__/ts-errors.spec.ts @@ -9,7 +9,7 @@ describe('Typescript errors', () => { const stderr = result.stderr.toString(); expect(result.status).toBe(1); - expect(stderr).toContain('Hello.ts:13:11'); + expect(stderr).toContain('Hello.ts:18:11'); expect(stderr).toContain('Hello.test.ts:9:19'); }); diff --git a/tests/simple/Hello.ts b/tests/simple/Hello.ts index c2dfee9115..2761d2e6cb 100644 --- a/tests/simple/Hello.ts +++ b/tests/simple/Hello.ts @@ -1,3 +1,8 @@ +interface FooInterface { + foo: string, + bar: number, //This interface should be stripped and the line numbers should still fit. +} + export class Hello { constructor() { const greeting = ` diff --git a/tests/simple/__tests__/Hello.test.ts b/tests/simple/__tests__/Hello.test.ts index e38144b4cd..6c8637fe71 100644 --- a/tests/simple/__tests__/Hello.test.ts +++ b/tests/simple/__tests__/Hello.test.ts @@ -4,7 +4,7 @@ import { Hello } from '../Hello'; describe('Hello Class', () => { - it('should throw an error on line 13', () => { + it('should throw an error on line 18', () => { const hello = new Hello(); From 87630d81b6b26e83a0af70cf45b447408f176d7d Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:46:33 +0200 Subject: [PATCH 190/256] maybe two spaces is right --- .editorconfig | 4 +-- src/postprocess.ts | 82 +++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.editorconfig b/.editorconfig index a114cc315f..b3137e4c35 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ [*.ts] indent_style = space -indent_size = 4 +indent_size = 2 [*.tsx] indent_style = space -indent_size = 4 \ No newline at end of file +indent_size = 2 \ No newline at end of file diff --git a/src/postprocess.ts b/src/postprocess.ts index 81dc1a91a4..5e4180f3d8 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -8,52 +8,52 @@ import * as babel from 'babel-core'; import {CompilerOptions} from 'typescript/lib/typescript'; function createBabelTransformer(options: PostProcessorOptions) { - options = { - ...options, - plugins: (options && options.plugins) || [], - presets: ((options && options.presets) || []).concat([jestPreset]), - retainLines: true, - }; - delete options.cacheDirectory; - delete options.filename; + options = { + ...options, + plugins: (options && options.plugins) || [], + presets: ((options && options.presets) || []).concat([jestPreset]), + retainLines: true, + }; + delete options.cacheDirectory; + delete options.filename; - return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({filename}, options); - if (transformOptions && transformOptions.instrument) { - theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; - // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - require('babel-plugin-istanbul').default, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); - } - return babel.transform(src, theseOptions).code; - }; + return (src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; + }; } export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { - if (tsJestConfig.skipBabel) { - return (src) => src; //Identity function - } + if (tsJestConfig.skipBabel) { + return (src) => src; //Identity function + } - const plugins = []; - //If we're not skipping babel - if (tsCompilerOptions.allowSyntheticDefaultImports) { - plugins.push('transform-es2015-modules-commonjs'); - } + const plugins = []; + //If we're not skipping babel + if (tsCompilerOptions.allowSyntheticDefaultImports) { + plugins.push('transform-es2015-modules-commonjs'); + } - return createBabelTransformer({ - presets: [], - plugins: plugins, - }); + return createBabelTransformer({ + presets: [], + plugins: plugins, + }); }; From 580f841655ca2d80de8ae60d9eda1ed3c7970294 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:48:33 +0200 Subject: [PATCH 191/256] one? --- .editorconfig | 4 +-- src/postprocess.ts | 82 +++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.editorconfig b/.editorconfig index b3137e4c35..f7a6af76e0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ [*.ts] indent_style = space -indent_size = 2 +indent_size = 1 [*.tsx] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 1 \ No newline at end of file diff --git a/src/postprocess.ts b/src/postprocess.ts index 5e4180f3d8..c1ba48355b 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -8,52 +8,52 @@ import * as babel from 'babel-core'; import {CompilerOptions} from 'typescript/lib/typescript'; function createBabelTransformer(options: PostProcessorOptions) { - options = { - ...options, - plugins: (options && options.plugins) || [], - presets: ((options && options.presets) || []).concat([jestPreset]), - retainLines: true, - }; - delete options.cacheDirectory; - delete options.filename; + options = { + ...options, + plugins: (options && options.plugins) || [], + presets: ((options && options.presets) || []).concat([jestPreset]), + retainLines: true, + }; + delete options.cacheDirectory; + delete options.filename; - return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({filename}, options); - if (transformOptions && transformOptions.instrument) { - theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; - // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - require('babel-plugin-istanbul').default, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); - } - return babel.transform(src, theseOptions).code; - }; + return (src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; + }; } export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { - if (tsJestConfig.skipBabel) { - return (src) => src; //Identity function - } + if (tsJestConfig.skipBabel) { + return (src) => src; //Identity function + } - const plugins = []; - //If we're not skipping babel - if (tsCompilerOptions.allowSyntheticDefaultImports) { - plugins.push('transform-es2015-modules-commonjs'); - } + const plugins = []; + //If we're not skipping babel + if (tsCompilerOptions.allowSyntheticDefaultImports) { + plugins.push('transform-es2015-modules-commonjs'); + } - return createBabelTransformer({ - presets: [], - plugins: plugins, - }); + return createBabelTransformer({ + presets: [], + plugins: plugins, + }); }; From 1e2a83a01665409e2e739b20d924a262d65587c5 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:50:09 +0200 Subject: [PATCH 192/256] ok we'll go with four --- .editorconfig | 4 +-- src/postprocess.ts | 82 +++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.editorconfig b/.editorconfig index f7a6af76e0..a114cc315f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ [*.ts] indent_style = space -indent_size = 1 +indent_size = 4 [*.tsx] indent_style = space -indent_size = 1 \ No newline at end of file +indent_size = 4 \ No newline at end of file diff --git a/src/postprocess.ts b/src/postprocess.ts index c1ba48355b..81dc1a91a4 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -8,52 +8,52 @@ import * as babel from 'babel-core'; import {CompilerOptions} from 'typescript/lib/typescript'; function createBabelTransformer(options: PostProcessorOptions) { - options = { - ...options, - plugins: (options && options.plugins) || [], - presets: ((options && options.presets) || []).concat([jestPreset]), - retainLines: true, - }; - delete options.cacheDirectory; - delete options.filename; + options = { + ...options, + plugins: (options && options.plugins) || [], + presets: ((options && options.presets) || []).concat([jestPreset]), + retainLines: true, + }; + delete options.cacheDirectory; + delete options.filename; - return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({filename}, options); - if (transformOptions && transformOptions.instrument) { - theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; - // Copied from jest-runtime transform.js - theseOptions.plugins = theseOptions.plugins.concat([ - [ - require('babel-plugin-istanbul').default, - { - // files outside `cwd` will not be instrumented - cwd: config.rootDir, - exclude: [], - }, - ], - ]); - } - return babel.transform(src, theseOptions).code; - }; + return (src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({filename}, options); + if (transformOptions && transformOptions.instrument) { + theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; + // Copied from jest-runtime transform.js + theseOptions.plugins = theseOptions.plugins.concat([ + [ + require('babel-plugin-istanbul').default, + { + // files outside `cwd` will not be instrumented + cwd: config.rootDir, + exclude: [], + }, + ], + ]); + } + return babel.transform(src, theseOptions).code; + }; } export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { - if (tsJestConfig.skipBabel) { - return (src) => src; //Identity function - } + if (tsJestConfig.skipBabel) { + return (src) => src; //Identity function + } - const plugins = []; - //If we're not skipping babel - if (tsCompilerOptions.allowSyntheticDefaultImports) { - plugins.push('transform-es2015-modules-commonjs'); - } + const plugins = []; + //If we're not skipping babel + if (tsCompilerOptions.allowSyntheticDefaultImports) { + plugins.push('transform-es2015-modules-commonjs'); + } - return createBabelTransformer({ - presets: [], - plugins: plugins, - }); + return createBabelTransformer({ + presets: [], + plugins: plugins, + }); }; From d7e53a8eff8082230afed938f9d5e4ee7fcee224 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:51:12 +0200 Subject: [PATCH 193/256] line feed --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index a114cc315f..ee8367f852 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,4 @@ indent_size = 4 [*.tsx] indent_style = space -indent_size = 4 \ No newline at end of file +indent_size = 4 From f8822db8ea3cbde7e5c55b66360f22b83e72f9a2 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:52:11 +0200 Subject: [PATCH 194/256] line feed --- tests/hoist-test/package.json | 2 +- tests/hoist-test/src/things-to-mock.ts | 2 +- tests/hoist-test/tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hoist-test/package.json b/tests/hoist-test/package.json index a4585ceb21..c2f99eac77 100644 --- a/tests/hoist-test/package.json +++ b/tests/hoist-test/package.json @@ -11,4 +11,4 @@ "js" ] } -} \ No newline at end of file +} diff --git a/tests/hoist-test/src/things-to-mock.ts b/tests/hoist-test/src/things-to-mock.ts index b5a1a251e0..bb656fdd3e 100644 --- a/tests/hoist-test/src/things-to-mock.ts +++ b/tests/hoist-test/src/things-to-mock.ts @@ -7,4 +7,4 @@ export const SomeFunctionDeclaredAsConst = () => 'originalValue'; export function SomeFunction(){ return 'original'; -} \ No newline at end of file +} diff --git a/tests/hoist-test/tsconfig.json b/tests/hoist-test/tsconfig.json index e2b8966352..9af8d1760f 100644 --- a/tests/hoist-test/tsconfig.json +++ b/tests/hoist-test/tsconfig.json @@ -9,4 +9,4 @@ "baseUrl": "src", "allowSyntheticDefaultImports": false } -} \ No newline at end of file +} From 609b533b05bb791d7484400e0a46a50ff6e6463c Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 11:55:43 +0200 Subject: [PATCH 195/256] format --- src/postprocess.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index 81dc1a91a4..a2fcf5f7b4 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -3,9 +3,9 @@ * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js */ import * as jestPreset from 'babel-preset-jest'; -import {JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions} from './jest-types'; +import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; import * as babel from 'babel-core'; -import {CompilerOptions} from 'typescript/lib/typescript'; +import { CompilerOptions } from 'typescript/lib/typescript'; function createBabelTransformer(options: PostProcessorOptions) { options = { From 7e927e3d529a00c29dc87769b9da3ad8d7c7146e Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 31 May 2017 14:13:03 +0200 Subject: [PATCH 196/256] format --- package.json | 1 + yarn.lock | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/package.json b/package.json index fed3fd8a2a..3a01d1bb1b 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ ] }, "dependencies": { + "@types/babel-core": "^6.7.14", "babel-core": "^6.24.1", "babel-plugin-istanbul": "^4.1.4", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", diff --git a/yarn.lock b/yarn.lock index 3c3ff92a87..d20d2cf4de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,37 @@ # yarn lockfile v1 +"@types/babel-core@^6.7.14": + version "6.7.14" + resolved "https://registry.yarnpkg.com/@types/babel-core/-/babel-core-6.7.14.tgz#a08c900a98e8987c1a98d2ea4fa0a1805a7d131f" + dependencies: + "@types/babel-template" "*" + "@types/babel-traverse" "*" + "@types/babel-types" "*" + +"@types/babel-template@*": + version "6.7.14" + resolved "https://registry.yarnpkg.com/@types/babel-template/-/babel-template-6.7.14.tgz#8088a56f9d697d620d3d079c3ef66025b7a08d02" + dependencies: + "@types/babel-types" "*" + "@types/babylon" "*" + +"@types/babel-traverse@*": + version "6.7.16" + resolved "https://registry.yarnpkg.com/@types/babel-traverse/-/babel-traverse-6.7.16.tgz#52f475893b8633f653499d745302fa5572a7bd05" + dependencies: + "@types/babel-types" "*" + +"@types/babel-types@*": + version "6.7.16" + resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-6.7.16.tgz#e2602896636858a0067971f7ca4bb8678038293f" + +"@types/babylon@*": + version "6.16.1" + resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.1.tgz#e4d10ab9e43a73703a17c6f41438bede28769340" + dependencies: + "@types/babel-types" "*" + "@types/es6-shim@latest": version "0.31.33" resolved "https://registry.yarnpkg.com/@types/es6-shim/-/es6-shim-0.31.33.tgz#4792bdecc8c7f09a7e086968cfbb8058e459379d" From f251ca9138710140df706c1a77f13390b4e087b5 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Thu, 1 Jun 2017 13:54:54 +0200 Subject: [PATCH 197/256] commit failing test --- tests/__tests__/jest-hoist.spec.ts | 10 +++++ tests/hoist-errors/.gitignore | 1 + tests/hoist-errors/Hello.ts | 51 ++++++++++++++++++++++ tests/hoist-errors/NullCoverage.js | 6 +++ tests/hoist-errors/__tests__/Hello.test.ts | 26 +++++++++++ tests/hoist-errors/package.json | 21 +++++++++ tests/hoist-errors/tsconfig.json | 10 +++++ 7 files changed, 125 insertions(+) create mode 100644 tests/hoist-errors/.gitignore create mode 100644 tests/hoist-errors/Hello.ts create mode 100644 tests/hoist-errors/NullCoverage.js create mode 100644 tests/hoist-errors/__tests__/Hello.test.ts create mode 100644 tests/hoist-errors/package.json create mode 100644 tests/hoist-errors/tsconfig.json diff --git a/tests/__tests__/jest-hoist.spec.ts b/tests/__tests__/jest-hoist.spec.ts index 9c2c24c1d2..1121542887 100644 --- a/tests/__tests__/jest-hoist.spec.ts +++ b/tests/__tests__/jest-hoist.spec.ts @@ -10,4 +10,14 @@ describe('Jest.mock() calls', () => { expect(result.status).toBe(0); }); + + it('Should retain proper line endings while hoisting', () => { + const result = runJest('../hoist-errors', ['--no-cache']); + + const stderr = result.stderr.toString(); + + expect(result.status).toBe(1); + expect(stderr).toContain('Hello.ts:30'); + expect(stderr).toContain('Hello.test.ts:16'); + }); }); diff --git a/tests/hoist-errors/.gitignore b/tests/hoist-errors/.gitignore new file mode 100644 index 0000000000..9e233d795a --- /dev/null +++ b/tests/hoist-errors/.gitignore @@ -0,0 +1 @@ +coverage-custom diff --git a/tests/hoist-errors/Hello.ts b/tests/hoist-errors/Hello.ts new file mode 100644 index 0000000000..25ad0fa11c --- /dev/null +++ b/tests/hoist-errors/Hello.ts @@ -0,0 +1,51 @@ +interface FooInterface { + foo: string, + bar: number, //This interface should be stripped and the line numbers should still fit. +} + +export const foo = () => { + console.log('foo'); +}; + + +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); + +export class Hello { + constructor() { + const greeting = ` + this + is + a + multiline + greeting + `; + + this.unexcuted(() => { }); + + throw new Error('Hello error!'); + } + + public unexcuted(action: () => void = () => { }): void { + if (action) { + action(); + } else { + console.log('unexcuted'); + } + } +} + + +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); diff --git a/tests/hoist-errors/NullCoverage.js b/tests/hoist-errors/NullCoverage.js new file mode 100644 index 0000000000..eefe7a0cfb --- /dev/null +++ b/tests/hoist-errors/NullCoverage.js @@ -0,0 +1,6 @@ +function nullCoverageFunction(value) { + if (value) { + return value; + } + return null; +} \ No newline at end of file diff --git a/tests/hoist-errors/__tests__/Hello.test.ts b/tests/hoist-errors/__tests__/Hello.test.ts new file mode 100644 index 0000000000..809526aa3f --- /dev/null +++ b/tests/hoist-errors/__tests__/Hello.test.ts @@ -0,0 +1,26 @@ +declare var jest, describe, it, expect; + +import { Hello } from '../Hello'; + +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); + +describe('Hello Class', () => { + + it('should throw an error on line 30', () => { + + const hello = new Hello(); + + }); + +}); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); +jest.mock('path'); diff --git a/tests/hoist-errors/package.json b/tests/hoist-errors/package.json new file mode 100644 index 0000000000..c2d9c1f52b --- /dev/null +++ b/tests/hoist-errors/package.json @@ -0,0 +1,21 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "coverageReporters": [ + "json" + ], + "collectCoverageFrom": [ + "Hello.ts", + "NullCoverage.js" + ], + "mapCoverage": true, + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/hoist-errors/tsconfig.json b/tests/hoist-errors/tsconfig.json new file mode 100644 index 0000000000..55f8667f97 --- /dev/null +++ b/tests/hoist-errors/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true + } +} From 31c90141a60cbc10258e420b19d62b583067d0d9 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:04:23 +0530 Subject: [PATCH 198/256] Remove the mock calls from the test application file --- tests/hoist-errors/Hello.ts | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/tests/hoist-errors/Hello.ts b/tests/hoist-errors/Hello.ts index 25ad0fa11c..0a0534abf2 100644 --- a/tests/hoist-errors/Hello.ts +++ b/tests/hoist-errors/Hello.ts @@ -1,20 +1,12 @@ interface FooInterface { - foo: string, - bar: number, //This interface should be stripped and the line numbers should still fit. + foo: string, + bar: number, //This interface should be stripped and the line numbers should still fit. } export const foo = () => { - console.log('foo'); + console.log('foo'); }; - -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); - export class Hello { constructor() { const greeting = ` @@ -38,14 +30,3 @@ export class Hello { } } } - - -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); -jest.mock('path'); From 45da28ab67034d12fe95c6c51d3f00efb23ba4fc Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:05:16 +0530 Subject: [PATCH 199/256] Update the expected line numbers in the test for hoisting. --- tests/__tests__/jest-hoist.spec.ts | 6 ++++-- tests/hoist-errors/__tests__/Hello.test.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/__tests__/jest-hoist.spec.ts b/tests/__tests__/jest-hoist.spec.ts index 1121542887..18923e4340 100644 --- a/tests/__tests__/jest-hoist.spec.ts +++ b/tests/__tests__/jest-hoist.spec.ts @@ -17,7 +17,9 @@ describe('Jest.mock() calls', () => { const stderr = result.stderr.toString(); expect(result.status).toBe(1); - expect(stderr).toContain('Hello.ts:30'); - expect(stderr).toContain('Hello.test.ts:16'); + expect(stderr).toContain('Hello.ts:22'); + // The actual error occurs at line 16. However, because the mock calls + // are hoisted, this changes - in this case, to 26 + expect(stderr).toContain('Hello.test.ts:26'); }); }); diff --git a/tests/hoist-errors/__tests__/Hello.test.ts b/tests/hoist-errors/__tests__/Hello.test.ts index 809526aa3f..f08cd4a6e2 100644 --- a/tests/hoist-errors/__tests__/Hello.test.ts +++ b/tests/hoist-errors/__tests__/Hello.test.ts @@ -11,7 +11,7 @@ jest.mock('path'); describe('Hello Class', () => { - it('should throw an error on line 30', () => { + it('should throw an error on line 22', () => { const hello = new Hello(); From 467a853c16d26f8177207b997125bc02570d3c69 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:07:23 +0530 Subject: [PATCH 200/256] Force babel to generate inline sourcemaps --- src/postprocess.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index a2fcf5f7b4..a0854be4b5 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -18,10 +18,10 @@ function createBabelTransformer(options: PostProcessorOptions) { delete options.filename; return (src: string, - filename: string, - config: JestConfig, - transformOptions: TransformOptions): string => { - const theseOptions = Object.assign({filename}, options); + filename: string, + config: JestConfig, + transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({ filename }, options); if (transformOptions && transformOptions.instrument) { theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; // Copied from jest-runtime transform.js @@ -36,6 +36,11 @@ function createBabelTransformer(options: PostProcessorOptions) { ], ]); } + + // force the sourceMaps property to be 'inline' during testing + // to help generate accurage sourcemaps. + theseOptions.sourceMaps = 'inline'; + return babel.transform(src, theseOptions).code; }; } From 541f407a84874f6b0d5330475062a800a4db2571 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:12:14 +0530 Subject: [PATCH 201/256] Add column numbers to the hoist test --- tests/__tests__/jest-hoist.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/__tests__/jest-hoist.spec.ts b/tests/__tests__/jest-hoist.spec.ts index 18923e4340..e310185fdf 100644 --- a/tests/__tests__/jest-hoist.spec.ts +++ b/tests/__tests__/jest-hoist.spec.ts @@ -17,9 +17,11 @@ describe('Jest.mock() calls', () => { const stderr = result.stderr.toString(); expect(result.status).toBe(1); - expect(stderr).toContain('Hello.ts:22'); + expect(stderr).toContain('Hello.ts:22:11'); + // The actual error occurs at line 16. However, because the mock calls // are hoisted, this changes - in this case, to 26 - expect(stderr).toContain('Hello.test.ts:26'); + // The column numbers are accurate. + expect(stderr).toContain('Hello.test.ts:26:19'); }); }); From 73ad65b224e598b8af4a673ab6c2f01b863299b3 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:13:41 +0530 Subject: [PATCH 202/256] Set sourceMaps for babel during declaration of the options --- src/postprocess.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index a0854be4b5..ae7fc6912d 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -12,7 +12,12 @@ function createBabelTransformer(options: PostProcessorOptions) { ...options, plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), + // If retainLines isn't set to true, the line numbers + // are off by 1 retainLines: true, + // force the sourceMaps property to be 'inline' during testing + // to help generate accurage sourcemaps. + sourceMaps: 'inline' }; delete options.cacheDirectory; delete options.filename; @@ -37,10 +42,6 @@ function createBabelTransformer(options: PostProcessorOptions) { ]); } - // force the sourceMaps property to be 'inline' during testing - // to help generate accurage sourcemaps. - theseOptions.sourceMaps = 'inline'; - return babel.transform(src, theseOptions).code; }; } From 03c841e6dcff02558517fad167f87e1944f16090 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Sat, 3 Jun 2017 17:14:30 +0530 Subject: [PATCH 203/256] Fix typo in a comment --- src/postprocess.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index ae7fc6912d..d699bba355 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -16,7 +16,7 @@ function createBabelTransformer(options: PostProcessorOptions) { // are off by 1 retainLines: true, // force the sourceMaps property to be 'inline' during testing - // to help generate accurage sourcemaps. + // to help generate accurate sourcemaps. sourceMaps: 'inline' }; delete options.cacheDirectory; From c21b525f343c86f2790f80d17cec4c82c84eb73d Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 8 Jun 2017 00:40:49 +0530 Subject: [PATCH 204/256] Update .travis.yml Test with Node v8 instead of v7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f8ef68935e..1fac720f46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "7" + - "8" - "6" - "4" before_install: From 0d23e0a10f899892d133f1dc033b19a74b4adbb0 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 8 Jun 2017 00:42:59 +0530 Subject: [PATCH 205/256] Update appveyor.yml Test with Node v8 instead of v7 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 2e463ce502..cba4dd5486 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: matrix: - nodejs_version: 4 - nodejs_version: 6 - - nodejs_version: 7 + - nodejs_version: 8 # get the latest stable version of Node 0.STABLE.latest install: From 5345cfb989d303fdd9a26e28c45ee5476dafa171 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Fri, 9 Jun 2017 11:41:24 +0530 Subject: [PATCH 206/256] Bump version to 20.0.6 This version includes the fix for hoisting mock calls --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a01d1bb1b..0e7ac2c538 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.5", + "version": "20.0.6", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest", From f6efe0f9705725e597dc09182483f77d53231ccd Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 13 Jun 2017 08:45:54 +0200 Subject: [PATCH 207/256] updated readme --- README.md | 167 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 123 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index bc6ba4e9f0..762a349a8e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ > 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 sensible defaults, that quickly allows you to get going, testing typescript code with jest. ## Table of Contents @@ -29,9 +30,25 @@ -## Versioning -From version `"jest": "17.0.0"` we are using same MAJOR.MINOR as [`Jest`](https://github.com/facebook/jest). -For `"jest": "< 17.0.0"` use `"ts-jest": "0.1.13"`. Docs for it see [here](https://github.com/kulshekhar/ts-jest/blob/e1f95e524ed62091736f70abf63530f1f107ec03/README.md). + + short intro + Usage + Sensible defaults + sourcemap support + Autolocates tsconfig + Automatic transpilation of modules if enabled in tsconfig (mention skipbabel) + Supports hoisting of jest.mock, mention skipBabel and limitations + Configuration, for when you need that little extra + TS_CONFIG stuff + skipBabel flag + Use cases + Angular 2 (compile html stuff) + React native + Limitations + Current limitations + Tips + same as now + ## Usage @@ -57,6 +74,10 @@ Modify your project's `package.json` so that the `jest` section looks something ``` This setup should allow you to write Jest tests in Typescript and be able to locate errors without any additional gymnastics. +### Versioning +From version `"jest": "17.0.0"` we are using same MAJOR.MINOR as [`Jest`](https://github.com/facebook/jest). +For `"jest": "< 17.0.0"` use `"ts-jest": "0.1.13"`. Docs for it see [here](https://github.com/kulshekhar/ts-jest/blob/e1f95e524ed62091736f70abf63530f1f107ec03/README.md). + ### Coverage Prior to version `20.0.0`, coverage reports could be obtained using the inbuilt coverage processor in `ts-jest`. Starting with version `20.0.0`, `ts-jest` delegates coverage processing to jest and no longer includes a coverage processor. @@ -65,6 +86,87 @@ To generate coverage results, set the `mapCoverage` property in the `jest` confi > Please note that the `outDir` property in the `jest` configuration section is removed in coverage mode, due to [#201](https://github.com/kulshekhar/ts-jest/issues/201). +## Sensible Defaults +ts-jest tries to ship with sensible defaults, to get you on your feet as quickly as possible. + +### Sourcemap support +Sourcemaps should work out of the box, that means your stacktraces should have the correct line numbers, +and your breakpoints should work. + +### Automatically finds .tsconfig.json +ts-jest automatically finds your .tsconfig.json and uses that. If you want to run typescript with a special configuration, you [also can](#ADDLINK)//TODO + +### Supports synthetic modules +If you're on a codebase where you're using synthetic default exports, e.g. +```javascript 1.6 +//Regular default exports +import * as React from 'react'; + +//Synthetic default exports: +import React from 'react'; +``` +ts-jest tries to support that. If `allowSyntheticDefaultExports` is set to true in your tsconfig file, it uses babel +to automatically create the synthetic default exports for you - nothing else needed. +You can opt-out of this behaviour with the [skipBabel flag](#Skipping Babel) + +### Supports automatic of jest.mock() calls +[Just like Jest](https://facebook.github.io/jest/docs/manual-mocks.html#using-with-es-module-imports) ts-jest +automatically hoists your `jest.mock()` calls to the top of your file. +You can opt-out of this behaviour with the [skipBabel flag](#Skipping Babel) + +## Configuration +Sometimes you just need a little extra configurability. + + +### tsconfig +By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. + +But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: +```json +{ + "jest": { + "globals": { + "__TS_CONFIG__": "my-tsconfig.json" + } + } +} +``` +Or even declare options for `tsc` instead of using separate config, like this: +```json +{ + "jest": { + "globals": { + "__TS_CONFIG__": { + "module": "commonjs", + "jsx": "react" + } + } + } +} +``` +For all available `tsc` options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). + +Note that if you haven't explicitly set the `module` property in the `__TS_CONFIG__` setting (either directly or through a separate configuration file), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. + +### Skipping Babel +If you want to skip the babel transpilation step in ts-jest, you can. This means `jest.mock()` calls will not be hoisted to the top, +and synthetic default exports will never be created. +Simply add skipBabel to your global variables under the `ts-jest` key: +```json +//This will skip babel transpilation +{ + "jest": { + "globals": { + "ts-jest": { + "skipBabel": true + } + } + } +} +``` + +## Use cases + ### React Native There is a few additional steps if you want to use it with React Native. @@ -124,34 +226,7 @@ This will make ts-loader send the compiled typescript code through babel, and th This configuration will allow `debugger` statements to work properly in both WebStorm and VSCode. Breakpoints currently only work in WebStorm. -## Options -By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. - -But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: -```json -{ - "jest": { - "globals": { - "__TS_CONFIG__": "my-tsconfig.json" - } - } -} -``` -Or even declare options for `tsc` instead of using separate config, like this: -```json -{ - "jest": { - "globals": { - "__TS_CONFIG__": { - "module": "commonjs", - "jsx": "react" - } - } - } -} -``` -Note that if you haven't explicitly set the `module` property in the `__TS_CONFIG__` setting (either directly or through a separate configuration file), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. - +## Angular 2 When using Jest with Angular (a.k.a Angular 2) apps you will likely need to parse HTML templates. If you're unable to add `html-loader` to webpack config (e.g. because you don't want to eject from `angular-cli`) you can do so by defining `__TRANSFORM_HTML__` key in `globals` for `jest`. ```json @@ -175,20 +250,7 @@ You'll also need to extend your `transform` regex with `html` extension: } ``` -For all available options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). - -### 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: -```json -"jest": { - "moduleDirectories": ["node_modules", ""] -} -``` - ## Tips - ### Importing packages written in TypeScript If you have dependencies on npm packages that are written in TypeScript but are @@ -208,6 +270,23 @@ your Jest configuration: By default Jest ignores everything in `node_modules`. This setting prevents Jest from ignoring the package you're interested in, in this case `@foo`, while continuing to ignore everything else in `node_modules`. + +## 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: +```json +"jest": { + "moduleDirectories": ["node_modules", ""] +} +``` + +### Known Limitations for autohoisting +If the `jest.mock()` calls is placed after actual code, (e.g. after functions or classes) and `skipBabel` is not set, +the line numbers in stacktraces will be off. +We suggest placing the `jest.mock()` calls after the imports, but before any actual code. + ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From bcb10ebea2438d294f4c4a3d8d8d7c09b800f0ba Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 13 Jun 2017 08:58:01 +0200 Subject: [PATCH 208/256] more update! --- README.md | 69 ++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 762a349a8e..835183d6e6 100644 --- a/README.md +++ b/README.md @@ -9,47 +9,40 @@ > 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 sensible defaults, that quickly allows you to get going, testing typescript code with jest. +`ts-jest` is a TypeScript preprocessor for Jest with sourceMap support and +sensible defaults that quickly allows you to start testing TypeScript with Jest. ## Table of Contents -- [Versioning](#versioning) - [Usage](#usage) + - [Versioning](#versioning) - [Coverage](#coverage) +- [Sensible Defaults](#sensible-defaults) + - [Sourcemap support](#sourcemap-support) + - [Automatically finds tsconfig.json](#automatically-finds-tsconfigjson) + - [Supports synthetic modules](#supports-synthetic-modules) + - [Supports automatic of jest.mock() calls](#supports-automatic-of-jestmock-calls) +- [Configuration](#configuration) + - [tsconfig](#tsconfig) + - [Skipping Babel](#skipping-babel) +- [Use cases](#use-cases) - [React Native](#react-native) -- [Options](#options) - - [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options) +- [Angular 2](#angular-2) - [Tips](#tips) - [Importing packages written in TypeScript](#importing-packages-written-in-typescript) +- [Known Limitations](#known-limitations) + - [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options) + - [Known Limitations for autohoisting](#known-limitations-for-autohoisting) + - [Current limitations for breakpoints](#current-limitations-for-breakpoints) - [How to Contribute](#how-to-contribute) - [Quickstart to run tests (only if you're working on this package)](#quickstart-to-run-tests-only-if-youre-working-on-this-package) - [License](#license) - - short intro - Usage - Sensible defaults - sourcemap support - Autolocates tsconfig - Automatic transpilation of modules if enabled in tsconfig (mention skipbabel) - Supports hoisting of jest.mock, mention skipBabel and limitations - Configuration, for when you need that little extra - TS_CONFIG stuff - skipBabel flag - Use cases - Angular 2 (compile html stuff) - React native - Limitations - Current limitations - Tips - same as now - - ## Usage To use this in your project, run: @@ -87,14 +80,15 @@ To generate coverage results, set the `mapCoverage` property in the `jest` confi > Please note that the `outDir` property in the `jest` configuration section is removed in coverage mode, due to [#201](https://github.com/kulshekhar/ts-jest/issues/201). ## Sensible Defaults -ts-jest tries to ship with sensible defaults, to get you on your feet as quickly as possible. +`ts-jest` tries to ship with sensible defaults, to get you on your feet as quickly as possible. ### Sourcemap support -Sourcemaps should work out of the box, that means your stacktraces should have the correct line numbers, -and your breakpoints should work. +SourceMaps should work out of the box, that means your stack traces should have the correct line numbers, +and you're able to step through the typescript code using a debugger. -### Automatically finds .tsconfig.json -ts-jest automatically finds your .tsconfig.json and uses that. If you want to run typescript with a special configuration, you [also can](#ADDLINK)//TODO +### Automatically finds tsconfig.json +`ts-jest` automatically located your `tsconfig` file. +If you want to run typescript with a special configuration, you [also can](#tsconfig) //TODO ### Supports synthetic modules If you're on a codebase where you're using synthetic default exports, e.g. @@ -105,23 +99,22 @@ import * as React from 'react'; //Synthetic default exports: import React from 'react'; ``` -ts-jest tries to support that. If `allowSyntheticDefaultExports` is set to true in your tsconfig file, it uses babel +`ts-jest` tries to support that. If `allowSyntheticDefaultExports` is set to true in your `tsconfig` file, it uses babel to automatically create the synthetic default exports for you - nothing else needed. -You can opt-out of this behaviour with the [skipBabel flag](#Skipping Babel) +You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) ### Supports automatic of jest.mock() calls -[Just like Jest](https://facebook.github.io/jest/docs/manual-mocks.html#using-with-es-module-imports) ts-jest +[Just like Jest](https://facebook.github.io/jest/docs/manual-mocks.html#using-with-es-module-imports) `ts-jest` automatically hoists your `jest.mock()` calls to the top of your file. -You can opt-out of this behaviour with the [skipBabel flag](#Skipping Babel) +You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) ## Configuration Sometimes you just need a little extra configurability. - ### tsconfig By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. -But you are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: +You are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: ```json { "jest": { @@ -216,7 +209,7 @@ If only testing typescript files then remove the `js` option in the testRegex. You might want to use ES6 default imports, which will allow you to write things like `import React from 'react';` -In that case you can add the following to your `.tsconfig` +In that case you can add the following to your `tsconfig` ```json "allowSyntheticDefaultImports": true ``` @@ -287,6 +280,10 @@ If the `jest.mock()` calls is placed after actual code, (e.g. after functions or the line numbers in stacktraces will be off. We suggest placing the `jest.mock()` calls after the imports, but before any actual code. +### Current limitations for breakpoints +Breakpoints currently work in WebStorm, but not Visual Studio Code. `debugger`; statements work in both, and will +map the TypeScript code correctly to the transpiled Javascript. + ## How to Contribute If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. From 22ecde8d02690dd6996a2472745826a0ba019acb Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 13 Jun 2017 09:03:43 +0200 Subject: [PATCH 209/256] more update! --- README.md | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 835183d6e6..62d7ca4601 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ > Note: Looking for collaborators. [Want to help improve ts-jest?](https://github.com/kulshekhar/ts-jest/issues/223) -`ts-jest` is a TypeScript preprocessor for Jest with sourceMap support and +`ts-jest` is a TypeScript preprocessor for Jest with source map support and sensible defaults that quickly allows you to start testing TypeScript with Jest. ## Table of Contents @@ -83,23 +83,23 @@ To generate coverage results, set the `mapCoverage` property in the `jest` confi `ts-jest` tries to ship with sensible defaults, to get you on your feet as quickly as possible. ### Sourcemap support -SourceMaps should work out of the box, that means your stack traces should have the correct line numbers, -and you're able to step through the typescript code using a debugger. +Sourcemaps should work out of the box. That means your stack traces should have the correct line numbers, +and you should be able to step through the TypeScript code using a debugger. ### Automatically finds tsconfig.json `ts-jest` automatically located your `tsconfig` file. -If you want to run typescript with a special configuration, you [also can](#tsconfig) //TODO +If you want to compile typescript with a special configuration, you [also can](#tsconfig) ### Supports synthetic modules -If you're on a codebase where you're using synthetic default exports, e.g. +If you're on a codebase where you're using synthetic default imports, e.g. ```javascript 1.6 -//Regular default exports +//Regular imports import * as React from 'react'; -//Synthetic default exports: +//Synthetic default imports: import React from 'react'; ``` -`ts-jest` tries to support that. If `allowSyntheticDefaultExports` is set to true in your `tsconfig` file, it uses babel +`ts-jest` tries to support that. If `allowSyntheticDefaultImports` is set to true in your `tsconfig` file, it uses babel to automatically create the synthetic default exports for you - nothing else needed. You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) @@ -206,19 +206,6 @@ Fully completed jest section should look like this: ``` If only testing typescript files then remove the `js` option in the testRegex. -You might want to use ES6 default imports, which will allow you to write things like -`import React from 'react';` - -In that case you can add the following to your `tsconfig` -```json - "allowSyntheticDefaultImports": true -``` - -This will make ts-loader send the compiled typescript code through babel, and the above import will resolve. - -This configuration will allow `debugger` statements to work properly in both WebStorm and VSCode. -Breakpoints currently only work in WebStorm. - ## Angular 2 When using Jest with Angular (a.k.a Angular 2) apps you will likely need to parse HTML templates. If you're unable to add `html-loader` to webpack config (e.g. because you don't want to eject from `angular-cli`) you can do so by defining `__TRANSFORM_HTML__` key in `globals` for `jest`. From 24c9beb81c579ad3f3c4f550fc14b4aed0661656 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Tue, 13 Jun 2017 13:33:00 +0200 Subject: [PATCH 210/256] made changes --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 62d7ca4601..5b8e85e458 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ > Note: Looking for collaborators. [Want to help improve ts-jest?](https://github.com/kulshekhar/ts-jest/issues/223) -`ts-jest` is a TypeScript preprocessor for Jest with source map support and -sensible defaults that quickly allows you to start testing TypeScript with Jest. +`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 @@ -20,7 +19,7 @@ sensible defaults that quickly allows you to start testing TypeScript with Jest. - [Usage](#usage) - [Versioning](#versioning) - [Coverage](#coverage) -- [Sensible Defaults](#sensible-defaults) +- [Default Setup](#default-setup) - [Sourcemap support](#sourcemap-support) - [Automatically finds tsconfig.json](#automatically-finds-tsconfigjson) - [Supports synthetic modules](#supports-synthetic-modules) @@ -35,7 +34,7 @@ sensible defaults that quickly allows you to start testing TypeScript with Jest. - [Importing packages written in TypeScript](#importing-packages-written-in-typescript) - [Known Limitations](#known-limitations) - [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options) - - [Known Limitations for autohoisting](#known-limitations-for-autohoisting) + - [Known Limitations for hoisting](#known-limitations-for-hoisting) - [Current limitations for breakpoints](#current-limitations-for-breakpoints) - [How to Contribute](#how-to-contribute) - [Quickstart to run tests (only if you're working on this package)](#quickstart-to-run-tests-only-if-youre-working-on-this-package) @@ -79,7 +78,7 @@ To generate coverage results, set the `mapCoverage` property in the `jest` confi > Please note that the `outDir` property in the `jest` configuration section is removed in coverage mode, due to [#201](https://github.com/kulshekhar/ts-jest/issues/201). -## Sensible Defaults +## Default Setup `ts-jest` tries to ship with sensible defaults, to get you on your feet as quickly as possible. ### Sourcemap support @@ -88,7 +87,7 @@ and you should be able to step through the TypeScript code using a debugger. ### Automatically finds tsconfig.json `ts-jest` automatically located your `tsconfig` file. -If you want to compile typescript with a special configuration, you [also can](#tsconfig) +If you want to compile typescript with a special configuration, you [can do that too](#tsconfig) ### Supports synthetic modules If you're on a codebase where you're using synthetic default imports, e.g. @@ -105,17 +104,19 @@ You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) ### Supports automatic of jest.mock() calls [Just like Jest](https://facebook.github.io/jest/docs/manual-mocks.html#using-with-es-module-imports) `ts-jest` -automatically hoists your `jest.mock()` calls to the top of your file. +automatically uses babel to hoist your `jest.mock()` calls to the top of your file. You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) ## Configuration -Sometimes you just need a little extra configurability. +If the default setup doesn't address your requirements, you can create a custom setup to suit your project. ### tsconfig By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. -You are able to override this behaviour and provide another path to your config for TypeScript by using `__TS_CONFIG__` option in `globals` for `jest`: -```json +You can override this behaviour by pointing ts-jest to a custom TypeScript configuration file. +You can do this by setting the `__TS_CONFIG__` option in globals for jest to the path of the +custom configuration file (relative to the project's root directory)```json +``` { "jest": { "globals": { @@ -142,7 +143,8 @@ For all available `tsc` options see [TypeScript docs](https://www.typescriptlang Note that if you haven't explicitly set the `module` property in the `__TS_CONFIG__` setting (either directly or through a separate configuration file), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. ### Skipping Babel -If you want to skip the babel transpilation step in ts-jest, you can. This means `jest.mock()` calls will not be hoisted to the top, +If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step. +This means `jest.mock()` calls will not be hoisted to the top, and synthetic default exports will never be created. Simply add skipBabel to your global variables under the `ts-jest` key: ```json @@ -262,7 +264,7 @@ By default Jest ignores everything in `node_modules`. This setting prevents Jest } ``` -### Known Limitations for autohoisting +### Known Limitations for hoisting If the `jest.mock()` calls is placed after actual code, (e.g. after functions or classes) and `skipBabel` is not set, the line numbers in stacktraces will be off. We suggest placing the `jest.mock()` calls after the imports, but before any actual code. From e0d6072972eb1404d4780097d712d1b73904a91d Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Tue, 13 Jun 2017 15:13:34 +0100 Subject: [PATCH 211/256] Tell people to also install @types/jest --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b8e85e458..7f6123d5ad 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To use this in your project, run: ```sh -npm install --save-dev ts-jest +npm install --save-dev ts-jes @types/jest" ``` Modify your project's `package.json` so that the `jest` section looks something like: ```json From 60bde917493ac933bfb754e7e6b68105449c084d Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 14 Jun 2017 16:34:04 +0200 Subject: [PATCH 212/256] removed requires --- src/postprocess.ts | 3 ++- src/preprocessor.ts | 5 +++-- src/utils.ts | 5 ++--- tests/__helpers__/runJest.ts | 6 +++--- tests/__helpers__/runJestInWatchMode.ts | 5 +++-- tests/__helpers__/utils.ts | 12 ++++++------ tests/__mocks__/path.ts | 5 +---- tests/__tests__/jestconfig-json.spec.ts | 6 +++--- tests/__tests__/jestconfig-package.spec.ts | 6 +++--- tests/__tests__/tsconfig-comments.spec.ts | 4 +++- tests/__tests__/tsconfig-default.spec.ts | 7 ++++--- tests/__tests__/tsconfig-inline.spec.ts | 5 +++-- 12 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/postprocess.ts b/src/postprocess.ts index d699bba355..21e2786e3d 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -6,6 +6,7 @@ import * as jestPreset from 'babel-preset-jest'; import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; import * as babel from 'babel-core'; import { CompilerOptions } from 'typescript/lib/typescript'; +import istanbulPlugin from 'babel-plugin-istanbul'; function createBabelTransformer(options: PostProcessorOptions) { options = { @@ -32,7 +33,7 @@ function createBabelTransformer(options: PostProcessorOptions) { // Copied from jest-runtime transform.js theseOptions.plugins = theseOptions.plugins.concat([ [ - require('babel-plugin-istanbul').default, + istanbulPlugin, { // files outside `cwd` will not be instrumented cwd: config.rootDir, diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 564f0fb9e6..b70527ad06 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -3,8 +3,9 @@ import * as crypto from 'crypto'; import * as tsc from 'typescript'; import { getTSConfig, getTSJestConfig } from './utils'; import * as nodepath from 'path'; -import { TransformOptions, Path, JestConfig, PostProcessHook } from './jest-types'; +import { TransformOptions, Path, JestConfig } from './jest-types'; import { getPostProcessHook } from './postprocess'; +import * as pkgDir from 'pkg-dir'; let tsJestConfig; @@ -18,7 +19,7 @@ export function process( if (tsJestConfig === undefined) { tsJestConfig = getTSJestConfig(config.globals); } - const root = require('pkg-dir').sync(); + const root = pkgDir.sync(); // transformOptions.instrument is a proxy for collectCoverage // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 const compilerOptions = getTSConfig(config.globals, transformOptions.instrument); diff --git a/src/utils.ts b/src/utils.ts index cedd80ba03..75c8180c21 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,9 +2,8 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; import * as tsconfig from 'tsconfig'; - -const normalize = require('jest-config').normalize; -const setFromArgv = require('jest-config/build/setFromArgv'); +import {normalize} from 'jest-config'; +import * as setFromArgv from 'jest-config/build/setfromArgv'; function parseConfig(argv) { if (argv.config && typeof argv.config === 'string') { diff --git a/tests/__helpers__/runJest.ts b/tests/__helpers__/runJest.ts index d8a0f8271a..e5245a8c0f 100644 --- a/tests/__helpers__/runJest.ts +++ b/tests/__helpers__/runJest.ts @@ -1,8 +1,8 @@ // from: https://github.com/facebook/jest/blob/master/integration_tests/runJest.js -const { fileExists } = require('./utils'); -const path = require('path'); -const spawnSync = require('cross-spawn').sync; +import { fileExists } from './utils'; +import * as path from 'path'; +import {sync as spawnSync} from 'cross-spawn'; // assuming that jest is installed globally // using `npm i -g jest-cli` diff --git a/tests/__helpers__/runJestInWatchMode.ts b/tests/__helpers__/runJestInWatchMode.ts index de3658fa4f..89a6a97458 100644 --- a/tests/__helpers__/runJestInWatchMode.ts +++ b/tests/__helpers__/runJestInWatchMode.ts @@ -1,7 +1,8 @@ // from: https://github.com/facebook/jest/blob/master/integration_tests/runJest.js import { ChildProcess, SpawnOptions } from 'child_process'; import { fileExists } from './utils'; -const path = require('path'); +import * as path from 'path'; + const spawn: (command: string, args?: string[], options?: SpawnOptions) => ChildProcess = (process.platform === 'win32') ? require('cross-spawn-with-kill') : require('cross-spawn'); @@ -49,4 +50,4 @@ export default function runJestInWatchMode(dir, args?: any[]) { }; return { childProcess, getStderrAsync }; -} \ No newline at end of file +} diff --git a/tests/__helpers__/utils.ts b/tests/__helpers__/utils.ts index 381a22e99d..e122f41d1e 100644 --- a/tests/__helpers__/utils.ts +++ b/tests/__helpers__/utils.ts @@ -2,9 +2,9 @@ import { } from 'jest'; import { } from 'node'; import * as fs from 'fs'; // from: https://github.com/facebook/jest/blob/master/integration_tests/utils.js - -const {spawnSync} = require('cross-spawn').sync; -const path = require('path'); +import {sync} from 'cross-spawn'; +import {sync as spawnSync} from 'cross-spawn'; +import * as path from 'path'; export function run(cmd, cwd) { const args = cmd.split(/\s/).slice(1); @@ -23,7 +23,7 @@ export function run(cmd, cwd) { } return result; -}; +} export function linkJestPackage(packageName, cwd) { const packagesDir = path.resolve(__dirname, '../packages'); @@ -31,7 +31,7 @@ export function linkJestPackage(packageName, cwd) { const destination = path.resolve(cwd, 'node_modules/'); run(`mkdir -p ${destination}`, undefined); return run(`ln -sf ${packagePath} ${destination}`, undefined); -}; +} export function fileExists(filePath) { const F_OK = fs.constants && fs.constants.F_OK || fs['F_OK']; @@ -41,4 +41,4 @@ export function fileExists(filePath) { } catch (e) { return false; } -}; \ No newline at end of file +} diff --git a/tests/__mocks__/path.ts b/tests/__mocks__/path.ts index 9a3474b60a..48c54b993d 100644 --- a/tests/__mocks__/path.ts +++ b/tests/__mocks__/path.ts @@ -1,7 +1,4 @@ -import { } from 'jest'; -import { } from 'node'; - -interface MockedPath { +export interface MockedPath { __setBaseDir(newBaseDir); resolve(...args); dirname(...args); diff --git a/tests/__tests__/jestconfig-json.spec.ts b/tests/__tests__/jestconfig-json.spec.ts index f51ae48b79..cda6c00886 100644 --- a/tests/__tests__/jestconfig-json.spec.ts +++ b/tests/__tests__/jestconfig-json.spec.ts @@ -1,13 +1,13 @@ +import * as pkgDir from 'pkg-dir'; +import { getJestConfig } from '../../src/utils'; + describe('get json jest config', () => { - const pkgDir = require('pkg-dir'); let yargsMock; - let getJestConfig; beforeEach(() => { jest.resetModules(); yargsMock = jest.fn(); jest.setMock('yargs', yargsMock); - getJestConfig = require('../../src/utils').getJestConfig; }); it('should able to read config from json', () => { diff --git a/tests/__tests__/jestconfig-package.spec.ts b/tests/__tests__/jestconfig-package.spec.ts index bade97091d..4fa6399897 100644 --- a/tests/__tests__/jestconfig-package.spec.ts +++ b/tests/__tests__/jestconfig-package.spec.ts @@ -1,13 +1,13 @@ +const pkgDir = require('pkg-dir'); +import { getJestConfig } from '../../src/utils'; + describe('get package json config', () => { - const pkgDir = require('pkg-dir'); let yargsMock; - let getJestConfig; beforeEach(() => { jest.resetModules(); yargsMock = jest.fn(); jest.setMock('yargs', yargsMock); - getJestConfig = require('../../src/utils').getJestConfig; }); it('should able to read config from package.json', () => { diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index aa6030b60c..235947aed8 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -1,7 +1,9 @@ +import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as fs from 'fs'; import * as tsconfig from 'tsconfig'; import {getTSConfig} from '../../src/utils'; +import * as path from 'path'; describe('parse tsconfig with comments', () => { @@ -10,7 +12,7 @@ describe('parse tsconfig with comments', () => { beforeEach(() => { // Set up some mocked out file info before each test - require('path').__setBaseDir('./tests/tsconfig-test'); + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test'); }); it('the two config files should exist', () => { diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index c745bf5dac..d0eab11d2c 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -1,3 +1,4 @@ +import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as ts from 'typescript'; @@ -9,7 +10,7 @@ describe('get default ts config', () => { beforeEach(() => { // Set up some mocked out file info before each test - (path as any).__setBaseDir('./tests/tsconfig-test'); + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test'); }); it('should correctly read tsconfig.json', () => { @@ -83,7 +84,7 @@ describe('get default ts config', () => { // set the base directory such that we can use 'tsconfig.json' as the // config file name instead of 'dir/tsconfig.json' - require('path').__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test/tsconfig-module'); const config = getTSConfig({ '__TS_CONFIG__': 'tsconfig.json' @@ -93,7 +94,7 @@ describe('get default ts config', () => { }); it('should correctly read the ts-jest object within jest settings', () => { - require('path').__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test/tsconfig-module'); const { getTSJestConfig } = require('../../src/utils'); diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index 95239fdffd..157441100d 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -1,14 +1,15 @@ +import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as ts from 'typescript'; import {getTSConfig} from '../../src/utils'; - +import * as path from 'path'; describe('get inline ts config', () => { beforeEach(() => { // Set up some mocked out file info before each test - require('path').__setBaseDir('./tests/tsconfig-test'); + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test'); }); it('should correctly read inline tsconfig options', () => { From 946f962cfe5b0c73cf2add744a2f981091317229 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 15 Jun 2017 23:57:48 +0530 Subject: [PATCH 213/256] Temporary fix for travis --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 75c8180c21..c53200b66d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,7 +3,8 @@ import * as path from 'path'; import * as fs from 'fs'; import * as tsconfig from 'tsconfig'; import {normalize} from 'jest-config'; -import * as setFromArgv from 'jest-config/build/setfromArgv'; +const setFromArgv = require('jest-config/build/setFromArgv'); +// import * as setFromArgv from 'jest-config/build/setfromArgv'; function parseConfig(argv) { if (argv.config && typeof argv.config === 'string') { From a3935c6dd758d7ae63a54aa447d3459c1eaf2d7a Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Fri, 16 Jun 2017 01:03:17 +0100 Subject: [PATCH 214/256] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f6123d5ad..553146a383 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To use this in your project, run: ```sh -npm install --save-dev ts-jes @types/jest" +npm install --save-dev ts-jest @types/jest" ``` Modify your project's `package.json` so that the `jest` section looks something like: ```json From ad1d2c96043c13b9a18a333e5c06daf138f857fe Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Sat, 17 Jun 2017 12:09:36 +0530 Subject: [PATCH 215/256] Update AUTHORS Add @ForbesLindesay to author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index cb6ebf343d..79c558abef 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,6 +14,7 @@ David Sheldrick Emil Persson Eric Anderson Felipe Matos +Forbes Lindesay Gustav Wengel Henry Zektser Ihor Chulinda From 42a7690c6ee776792ee92a12e627a7a0957cd724 Mon Sep 17 00:00:00 2001 From: J Cheyo Jimenez Date: Sun, 18 Jun 2017 00:47:59 -0700 Subject: [PATCH 216/256] added workaround to error reporting --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 553146a383..c22934d6fe 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,8 @@ and you should be able to step through the TypeScript code using a debugger. `ts-jest` automatically located your `tsconfig` file. If you want to compile typescript with a special configuration, you [can do that too](#tsconfig) -### Supports synthetic modules -If you're on a codebase where you're using synthetic default imports, e.g. +### Supports synthetic modules +If you're on a codebase where you're using synthetic default imports, e.g. ```javascript 1.6 //Regular imports import * as React from 'react'; @@ -99,7 +99,7 @@ import * as React from 'react'; import React from 'react'; ``` `ts-jest` tries to support that. If `allowSyntheticDefaultImports` is set to true in your `tsconfig` file, it uses babel -to automatically create the synthetic default exports for you - nothing else needed. +to automatically create the synthetic default exports for you - nothing else needed. You can opt-out of this behaviour with the [skipBabel flag](#skipping-babel) ### Supports automatic of jest.mock() calls @@ -263,6 +263,10 @@ By default Jest ignores everything in `node_modules`. This setting prevents Jest "moduleDirectories": ["node_modules", ""] } ``` +### TS compiler && error reporting +- Only syntactic errors are reported by the [tsc `transpileModule`](https://github.com/Microsoft/TypeScript/issues/4864#issuecomment-141567247) +- Non syntactic errors do not show up in [Jest](https://github.com/facebook/jest/issues/2168) +- A workaround is to call the ts compiler before calling Jest `tsc --noEmit -p . && jest` ### Known Limitations for hoisting If the `jest.mock()` calls is placed after actual code, (e.g. after functions or classes) and `skipBabel` is not set, From b528d4b91ab7ef006799dac082467a1d247ba034 Mon Sep 17 00:00:00 2001 From: Jose Cheyo Jimenez Date: Sun, 18 Jun 2017 10:58:03 -0700 Subject: [PATCH 217/256] updated wording --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c22934d6fe..5c3021956b 100644 --- a/README.md +++ b/README.md @@ -264,9 +264,9 @@ By default Jest ignores everything in `node_modules`. This setting prevents Jest } ``` ### TS compiler && error reporting -- Only syntactic errors are reported by the [tsc `transpileModule`](https://github.com/Microsoft/TypeScript/issues/4864#issuecomment-141567247) -- Non syntactic errors do not show up in [Jest](https://github.com/facebook/jest/issues/2168) -- A workaround is to call the ts compiler before calling Jest `tsc --noEmit -p . && jest` +- ts-jest only returns syntax errors from [tsc](https://github.com/Microsoft/TypeScript/issues/4864#issuecomment-141567247) +- Non syntactic errors do not show up in [jest](https://github.com/facebook/jest/issues/2168) +- If you only want to run jest if tsc does not output any errors, a workaround is `tsc --noEmit -p . && jest` ### Known Limitations for hoisting If the `jest.mock()` calls is placed after actual code, (e.g. after functions or classes) and `skipBabel` is not set, From f46f290045cfc1cff1033614bcae0853642211b8 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Mon, 19 Jun 2017 12:48:52 +0530 Subject: [PATCH 218/256] Update AUTHORS Add masters3d to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 79c558abef..f9bffc2ec1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,6 +18,7 @@ Forbes Lindesay Gustav Wengel Henry Zektser Ihor Chulinda +J Cheyo Jimenez Joscha Feth Kulshekhar Kabra Kyle Roach From 17f04900d5f2c2a04e49e214a7d5bfc17dddbb56 Mon Sep 17 00:00:00 2001 From: DorianGrey Date: Thu, 15 Jun 2017 18:20:47 +0200 Subject: [PATCH 219/256] Use tsc to read config files, instead of separate tsconfig package --- package.json | 3 +- src/utils.ts | 85 +++++++++++++++----- tests/__tests__/tsconfig-comments.spec.ts | 10 ++- tests/tsconfig-test/allows-comments.json | 2 +- tests/tsconfig-test/allows-comments2.json | 1 + tests/tsconfig-test/empty.ts | 1 + tests/tsconfig-test/tsconfig-module/empty.ts | 1 + yarn.lock | 5 +- 8 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 tests/tsconfig-test/empty.ts create mode 100644 tests/tsconfig-test/tsconfig-module/empty.ts diff --git a/package.json b/package.json index 0e7ac2c538..76dc0c4a7c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "homepage": "https://github.com/kulshekhar/ts-jest#readme", "jest": { "transform": { - ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" + ".(ts|tsx)": "/dist/preprocessor.js" }, "testRegex": "/__tests__/.*\\.(spec)\\.(ts|js)$", "coverageReporters": [ @@ -66,7 +66,6 @@ "jest-util": "^20.0.0", "pkg-dir": "^2.0.0", "source-map-support": "^0.4.4", - "tsconfig": "^6.0.0", "yargs": "^8.0.1" }, "peerDependencies": { diff --git a/src/utils.ts b/src/utils.ts index c53200b66d..1418d73df1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,6 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; -import * as tsconfig from 'tsconfig'; import {normalize} from 'jest-config'; const setFromArgv = require('jest-config/build/setFromArgv'); // import * as setFromArgv from 'jest-config/build/setfromArgv'; @@ -67,40 +66,63 @@ export function getTSJestConfig(globals) { return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; } +function formatTscParserErrors(errors: tsc.Diagnostic[]) { + return errors.map(s => JSON.stringify(s, null, 4)).join('\n'); +} + +function readCompilerOptions(configPath: string) { + // First step: Let tsc pick up the config. + const loaded = tsc.readConfigFile(configPath, file => { + const read = tsc.sys.readFile(file); + // See https://github.com/Microsoft/TypeScript/blob/a757e8428410c2196886776785c16f8f0c2a62d9/src/compiler/sys.ts#L203 : + // `readFile` returns `undefined` in case the file does not exist! + if (!read) { + throw new Error(`ENOENT: no such file or directory, open '${configPath}'`); + } + return read; + }); + // In case of an error, we cannot go further - the config is malformed. + if (loaded.error) { + throw new Error(JSON.stringify(loaded.error, null, 4)); + } + + // Second step: Parse the config, resolving all potential references. + const basePath = path.dirname(configPath); // equal to "getDirectoryPath" from ts, at least in our case. + const parsedConfig = tsc.parseJsonConfigFileContent(loaded.config, tsc.sys, basePath); + // In case the config is present, it already contains possibly merged entries from following the + // 'extends' entry, thus it is not required to follow it manually. + // This procedure does NOT throw, but generates a list of errors that can/should be evaluated. + if (parsedConfig.errors.length > 0) { + const formattedErrors = formatTscParserErrors(parsedConfig.errors); + throw new Error(`Some errors occurred while attempting to read from ${configPath}: ${formattedErrors}`); + } + return parsedConfig.options; +} + export function getTSConfig(globals, collectCoverage: boolean = false) { let config = (globals && globals.__TS_CONFIG__) ? globals.__TS_CONFIG__ : 'tsconfig.json'; const skipBabel = getTSJestConfig(globals).skipBabel; + const isReferencedExternalFile = typeof config === 'string'; - if (typeof config === 'string') { + if (isReferencedExternalFile) { const configFileName = config; - const configPath = path.resolve(configFileName); - const fileContent = fs.readFileSync(configPath, 'utf8'); - const external = tsconfig.parse(fileContent, configPath); - config = external.compilerOptions || {}; - - if (typeof external.extends === 'string') { - const parentConfigPath = path.join(path.dirname(configPath), external.extends); - const includedContent = fs.readFileSync(parentConfigPath, 'utf8'); - config = Object.assign({}, tsconfig.parse(includedContent, parentConfigPath).compilerOptions, config); - } + const configPath = path.resolve(config); + + config = readCompilerOptions(configPath); if (configFileName === '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 // the global __TS_CONFIG__ setting in Jest config - config.module = 'commonjs'; + config.module = tsc.ModuleKind.CommonJS; } } - config.module = config.module || 'commonjs'; - if (config.inlineSourceMap !== false) { config.inlineSourceMap = true; } - config.jsx = config.jsx || tsc.JsxEmit.React; - //inline source with source map for remapping coverage if (collectCoverage) { delete config.sourceMap; @@ -113,9 +135,30 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { delete config.outDir; } - if (config.allowSyntheticDefaultImports && !skipBabel) { - // compile ts to es2015 and transform with babel afterwards - config.module = 'es2015'; + // Note: If we had to read the inline configuration, it's required to set the fields + // to their string properties, and convert the result accordingly afterwards. + // In case of an external file, reading the config file already converted it as well, and + // an additional attempt would lead to errors. + if (isReferencedExternalFile) { + config.jsx = config.jsx || tsc.JsxEmit.React; + config.module = config.module || tsc.ModuleKind.CommonJS; + if (config.allowSyntheticDefaultImports && !skipBabel) { + // compile ts to es2015 and transform with babel afterwards + config.module = tsc.ModuleKind.ES2015; + } + return config; + } else { + config.jsx = config.jsx || 'react'; + config.module = config.module || 'commmonjs'; + if (config.allowSyntheticDefaultImports && !skipBabel) { + // compile ts to es2015 and transform with babel afterwards + config.module = 'es2015'; + } + const converted = tsc.convertCompilerOptionsFromJson(config, undefined); + if (converted.errors && converted.errors.length > 0) { + const formattedErrors = formatTscParserErrors(converted.errors); + throw new Error(`Some errors occurred while attempting to convert ${JSON.stringify(config)}: ${formattedErrors}`); + } + return converted.options; } - return tsc.convertCompilerOptionsFromJson(config, undefined).options; } diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 235947aed8..3291eb6940 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -1,7 +1,6 @@ import { MockedPath } from '../__mocks__/path'; jest.mock('path'); import * as fs from 'fs'; -import * as tsconfig from 'tsconfig'; import {getTSConfig} from '../../src/utils'; import * as path from 'path'; @@ -35,10 +34,13 @@ describe('parse tsconfig with comments', () => { }); it('one config file should extend the other', () => { - const content = fs.readFileSync(configFile1, 'utf8'); - const config = tsconfig.parse(content, configFile1); + const config = getTSConfig({ + __TS_CONFIG__: 'allows-comments.json' + }); - expect(config.extends).toEqual('allows-comments2.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); }); it('should correctly read allow-comments.json', () => { diff --git a/tests/tsconfig-test/allows-comments.json b/tests/tsconfig-test/allows-comments.json index 0b87e2bff5..c74d470ac9 100644 --- a/tests/tsconfig-test/allows-comments.json +++ b/tests/tsconfig-test/allows-comments.json @@ -1,5 +1,5 @@ { - "extends": "allows-comments2.json", + "extends": "./allows-comments2.json", "compilerOptions": { // some comments } diff --git a/tests/tsconfig-test/allows-comments2.json b/tests/tsconfig-test/allows-comments2.json index fe6b094dc2..e5b406f1ca 100644 --- a/tests/tsconfig-test/allows-comments2.json +++ b/tests/tsconfig-test/allows-comments2.json @@ -1,5 +1,6 @@ { "compilerOptions": { //some comments + "pretty": true } } diff --git a/tests/tsconfig-test/empty.ts b/tests/tsconfig-test/empty.ts new file mode 100644 index 0000000000..e228bfe327 --- /dev/null +++ b/tests/tsconfig-test/empty.ts @@ -0,0 +1 @@ +// Dummy file to ensure the ts config loader does not complain about a missing input file. \ No newline at end of file diff --git a/tests/tsconfig-test/tsconfig-module/empty.ts b/tests/tsconfig-test/tsconfig-module/empty.ts new file mode 100644 index 0000000000..e228bfe327 --- /dev/null +++ b/tests/tsconfig-test/tsconfig-module/empty.ts @@ -0,0 +1 @@ +// Dummy file to ensure the ts config loader does not complain about a missing input file. \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d20d2cf4de..a3bc961aea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2474,9 +2474,10 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" ts-jest@latest: - version "20.0.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.5.tgz#6cb151e718e8739529d0a79459e09f7280fe044f" + version "20.0.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.6.tgz#39c2810c05d6f6908dac15929dae206b494b73f4" dependencies: + "@types/babel-core" "^6.7.14" babel-core "^6.24.1" babel-plugin-istanbul "^4.1.4" babel-plugin-transform-es2015-modules-commonjs "^6.24.1" From efbe0760b7df04126d1511e27f660156a8f2d064 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 21 Jun 2017 13:00:06 +0530 Subject: [PATCH 220/256] Update AUTHORS Add @DorianGrey to the author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f9bffc2ec1..94690afa8b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Chong Guo Christian Rackerseder Daniel Perez Alvarez David Sheldrick +DorianGrey Emil Persson Eric Anderson Felipe Matos From fa17d17a72bcfbecc3be9d55c06ceb9413a0d0d3 Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Wed, 21 Jun 2017 13:02:53 +0530 Subject: [PATCH 221/256] Fix author name Fix @DorianGrey's name --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 94690afa8b..032cdce4cd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,10 +8,10 @@ Andreas Krummsdorf Bartosz Gościński Blake Embrey Chong Guo +Christian Linne Christian Rackerseder Daniel Perez Alvarez David Sheldrick -DorianGrey Emil Persson Eric Anderson Felipe Matos From de5d3b252eea406f3d85d10f06c2b4e0ee4c9960 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Jul 2017 15:16:52 +0530 Subject: [PATCH 222/256] Use version 2.4.1 of typescript --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 76dc0c4a7c..5956a7a24b 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,6 @@ "rimraf": "latest", "ts-jest": "latest", "tslint": "next", - "typescript": "latest" + "typescript": "^2.4.1" } } diff --git a/yarn.lock b/yarn.lock index a3bc961aea..457b785afa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2530,9 +2530,9 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -typescript@latest: - version "2.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.3.tgz#9639f3c3b40148e8ca97fe08a51dd1891bb6be22" +typescript@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc" ua-parser-js@^0.7.9: version "0.7.12" From 441c10347b85a659702adbce0af07265b4c8c5a2 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Jul 2017 15:16:57 +0530 Subject: [PATCH 223/256] Fix type to address errors in tsc 2.4.1 --- src/jest-types.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jest-types.ts b/src/jest-types.ts index 0409611e19..449d4a707a 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -16,14 +16,16 @@ export type HasteConfig = { }; export interface PostProcessorOptions { - plugins? : any[]; + plugins?: any[]; presets?: any[]; - cacheDirectory? : string; + cacheDirectory?: string; filename?: string; + retainLines?: boolean; + sourceMaps?: string; } export interface PostProcessHook { - (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions) : string; + (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions): string; } export type JestConfig = Partial; From 7d0a2ba60ab4489984ef2a0ae2696ff49492e28f Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Jul 2017 16:05:09 +0530 Subject: [PATCH 224/256] Add a test to test dynamic imports --- tests/__tests__/dynamic-imports.spec.ts | 13 +++++++++++++ tests/dynamic-imports/__tests__/thing.test.ts | 17 +++++++++++++++++ tests/dynamic-imports/package.json | 13 +++++++++++++ tests/dynamic-imports/thing.ts | 3 +++ tests/dynamic-imports/tsconfig.json | 5 +++++ 5 files changed, 51 insertions(+) create mode 100644 tests/__tests__/dynamic-imports.spec.ts create mode 100644 tests/dynamic-imports/__tests__/thing.test.ts create mode 100644 tests/dynamic-imports/package.json create mode 100644 tests/dynamic-imports/thing.ts create mode 100644 tests/dynamic-imports/tsconfig.json diff --git a/tests/__tests__/dynamic-imports.spec.ts b/tests/__tests__/dynamic-imports.spec.ts new file mode 100644 index 0000000000..01d80ebcfd --- /dev/null +++ b/tests/__tests__/dynamic-imports.spec.ts @@ -0,0 +1,13 @@ +import runJest from '../__helpers__/runJest'; + +describe('Dynamic imports', () => { + + it('should work as expected', () => { + + const result = runJest('../dynamic-imports', ['--no-cache']); + + expect(result.status).toBe(0); + + }); + +}); diff --git a/tests/dynamic-imports/__tests__/thing.test.ts b/tests/dynamic-imports/__tests__/thing.test.ts new file mode 100644 index 0000000000..781df5948e --- /dev/null +++ b/tests/dynamic-imports/__tests__/thing.test.ts @@ -0,0 +1,17 @@ +// declare var jest, describe, it, expect; + +describe('Dynamically importing thing class', () => { + + it('should work as expected', async () => { + + const t = await import('../thing'); + + const t1 = new t.Thing(); + expect(t1.name).toBe('Default Name'); + + const t2 = new t.Thing('aa'); + expect(t2.name).toBe('aa'); + + }); + +}); diff --git a/tests/dynamic-imports/package.json b/tests/dynamic-imports/package.json new file mode 100644 index 0000000000..7599dba9b6 --- /dev/null +++ b/tests/dynamic-imports/package.json @@ -0,0 +1,13 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/dynamic-imports/thing.ts b/tests/dynamic-imports/thing.ts new file mode 100644 index 0000000000..3ce3722399 --- /dev/null +++ b/tests/dynamic-imports/thing.ts @@ -0,0 +1,3 @@ +export class Thing { + constructor(public name: string = 'Default Name') { } +} diff --git a/tests/dynamic-imports/tsconfig.json b/tests/dynamic-imports/tsconfig.json new file mode 100644 index 0000000000..42e12d9c51 --- /dev/null +++ b/tests/dynamic-imports/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "target": "ES5" + } +} From b97245e4a1a3f3795a9449bb959f8e823311ca34 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Tue, 4 Jul 2017 19:03:29 +0530 Subject: [PATCH 225/256] Add tests for dynamic imports when allowSyntheticDefaultImports is true --- tests/__tests__/dynamic-imports.spec.ts | 8 ++++++++ .../jest.allowdefaultimports.json | 17 +++++++++++++++++ .../tsconfig.allowdefaultimports.json | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/dynamic-imports/jest.allowdefaultimports.json create mode 100644 tests/dynamic-imports/tsconfig.allowdefaultimports.json diff --git a/tests/__tests__/dynamic-imports.spec.ts b/tests/__tests__/dynamic-imports.spec.ts index 01d80ebcfd..6adeb2e6a7 100644 --- a/tests/__tests__/dynamic-imports.spec.ts +++ b/tests/__tests__/dynamic-imports.spec.ts @@ -10,4 +10,12 @@ describe('Dynamic imports', () => { }); + it('should work with synthetic default imports', () => { + + const result = runJest('../dynamic-imports', ['--no-cache', '--config', 'jest.allowdefaultimports.json']); + + expect(result.status).toBe(0); + + }); + }); diff --git a/tests/dynamic-imports/jest.allowdefaultimports.json b/tests/dynamic-imports/jest.allowdefaultimports.json new file mode 100644 index 0000000000..755deb0cac --- /dev/null +++ b/tests/dynamic-imports/jest.allowdefaultimports.json @@ -0,0 +1,17 @@ +{ + "globals": { + "__TS_CONFIG__": "tsconfig.allowdefaultimports.json", + "ts-jest": { + "skipBabel": true + } + }, + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] +} diff --git a/tests/dynamic-imports/tsconfig.allowdefaultimports.json b/tests/dynamic-imports/tsconfig.allowdefaultimports.json new file mode 100644 index 0000000000..094bb80de7 --- /dev/null +++ b/tests/dynamic-imports/tsconfig.allowdefaultimports.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "target": "ES5", + "allowSyntheticDefaultImports": true + } +} From 93f9dc2b9f2f5306c419b1e134a401b4e0329c17 Mon Sep 17 00:00:00 2001 From: Gustav Wengel Date: Wed, 5 Jul 2017 17:25:16 +0200 Subject: [PATCH 226/256] don't use babelrc by default --- src/jest-types.ts | 20 ++++++++++--------- src/postprocess.ts | 9 +++++---- src/preprocessor.ts | 14 ++++++------- src/utils.ts | 3 ++- tests/__helpers__/runJest.ts | 3 ++- tests/__helpers__/utils.ts | 3 --- tests/__tests__/babelrc.spec.ts | 20 +++++++++++++++++++ tests/skip-babelrc/.babelrc | 3 +++ tests/skip-babelrc/.gitignore | 1 + tests/skip-babelrc/Hello.ts | 21 ++++++++++++++++++++ tests/skip-babelrc/NullCoverage.js | 6 ++++++ tests/skip-babelrc/__tests__/Hello.test.ts | 10 ++++++++++ tests/skip-babelrc/package.json | 21 ++++++++++++++++++++ tests/skip-babelrc/tsconfig.json | 10 ++++++++++ tests/use-babelrc/.babelrc | 3 +++ tests/use-babelrc/.gitignore | 1 + tests/use-babelrc/Hello.ts | 23 ++++++++++++++++++++++ tests/use-babelrc/NullCoverage.js | 6 ++++++ tests/use-babelrc/__tests__/Hello.test.ts | 11 +++++++++++ tests/use-babelrc/package.json | 22 +++++++++++++++++++++ tests/use-babelrc/tsconfig.json | 10 ++++++++++ yarn.lock | 2 +- 22 files changed, 195 insertions(+), 27 deletions(-) create mode 100644 tests/__tests__/babelrc.spec.ts create mode 100644 tests/skip-babelrc/.babelrc create mode 100644 tests/skip-babelrc/.gitignore create mode 100644 tests/skip-babelrc/Hello.ts create mode 100644 tests/skip-babelrc/NullCoverage.js create mode 100644 tests/skip-babelrc/__tests__/Hello.test.ts create mode 100644 tests/skip-babelrc/package.json create mode 100644 tests/skip-babelrc/tsconfig.json create mode 100644 tests/use-babelrc/.babelrc create mode 100644 tests/use-babelrc/.gitignore create mode 100644 tests/use-babelrc/Hello.ts create mode 100644 tests/use-babelrc/NullCoverage.js create mode 100644 tests/use-babelrc/__tests__/Hello.test.ts create mode 100644 tests/use-babelrc/package.json create mode 100644 tests/use-babelrc/tsconfig.json diff --git a/src/jest-types.ts b/src/jest-types.ts index 449d4a707a..1c14f0ecdc 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -1,12 +1,13 @@ -export type TransformOptions = { +import { TransformOptions as BabelTransformOpts } from 'babel-core'; +export interface TransformOptions { instrument: boolean; -}; +} export type Path = string; export type Glob = string; -export type ConfigGlobals = { [key: string]: any }; +export type ConfigGlobals = { [key: string]: any}; export type HasteConfig = { defaultPlatform?: string | null; @@ -15,13 +16,9 @@ export type HasteConfig = { providesModuleNodeModules: Array; }; -export interface PostProcessorOptions { - plugins?: any[]; - presets?: any[]; + +export interface BabelTransformOptions extends BabelTransformOpts{ cacheDirectory?: string; - filename?: string; - retainLines?: boolean; - sourceMaps?: string; } export interface PostProcessHook { @@ -65,3 +62,8 @@ export type FullJestConfig = { transformIgnorePatterns: Array; unmockedModulePathPatterns: Array | null; }; + +export interface TsJestConfig { + skipBabel?: boolean; + useBabelrc?: boolean; +} \ No newline at end of file diff --git a/src/postprocess.ts b/src/postprocess.ts index 21e2786e3d..5b6ea938c1 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -3,12 +3,12 @@ * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js */ import * as jestPreset from 'babel-preset-jest'; -import { JestConfig, PostProcessHook, PostProcessorOptions, TransformOptions } from './jest-types'; +import { BabelTransformOptions, JestConfig, PostProcessHook, TransformOptions, TsJestConfig } from './jest-types'; import * as babel from 'babel-core'; import { CompilerOptions } from 'typescript/lib/typescript'; import istanbulPlugin from 'babel-plugin-istanbul'; -function createBabelTransformer(options: PostProcessorOptions) { +function createBabelTransformer(options: BabelTransformOptions) { options = { ...options, plugins: (options && options.plugins) || [], @@ -22,7 +22,7 @@ function createBabelTransformer(options: PostProcessorOptions) { }; delete options.cacheDirectory; delete options.filename; - + return (src: string, filename: string, config: JestConfig, @@ -47,7 +47,7 @@ function createBabelTransformer(options: PostProcessorOptions) { }; } -export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: any): PostProcessHook => { +export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: TsJestConfig): PostProcessHook => { if (tsJestConfig.skipBabel) { return (src) => src; //Identity function } @@ -62,5 +62,6 @@ export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfi return createBabelTransformer({ presets: [], plugins: plugins, + babelrc: tsJestConfig.useBabelrc || false }); }; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index b70527ad06..9b90082636 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -7,26 +7,24 @@ import { TransformOptions, Path, JestConfig } from './jest-types'; import { getPostProcessHook } from './postprocess'; import * as pkgDir from 'pkg-dir'; - -let tsJestConfig; - export function process( src: string, path: Path, config: JestConfig, transformOptions: TransformOptions = { instrument: false }) { - - if (tsJestConfig === undefined) { - tsJestConfig = getTSJestConfig(config.globals); - } + + const compilerOptions = getTSConfig(config.globals, transformOptions.instrument); + const tsJestConfig = getTSJestConfig(config.globals); + const root = pkgDir.sync(); // transformOptions.instrument is a proxy for collectCoverage // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 - const compilerOptions = getTSConfig(config.globals, transformOptions.instrument); const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); + + let postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { diff --git a/src/utils.ts b/src/utils.ts index 1418d73df1..b25ad40f22 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,6 +2,7 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; import {normalize} from 'jest-config'; +import { TsJestConfig } from './jest-types'; const setFromArgv = require('jest-config/build/setFromArgv'); // import * as setFromArgv from 'jest-config/build/setfromArgv'; @@ -62,7 +63,7 @@ export function getJestConfig(root) { return Object.freeze(setFromArgv(rawConfig, argv)); } -export function getTSJestConfig(globals) { +export function getTSJestConfig(globals: any) : TsJestConfig { return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; } diff --git a/tests/__helpers__/runJest.ts b/tests/__helpers__/runJest.ts index e5245a8c0f..7800727371 100644 --- a/tests/__helpers__/runJest.ts +++ b/tests/__helpers__/runJest.ts @@ -11,7 +11,7 @@ const JEST_PATH = 'jest'; // return the result of the spawned proccess: // [ 'status', 'signal', 'output', 'pid', 'stdout', 'stderr', // 'envPairs', 'options', 'args', 'file' ] -export default function runJest(dir, args) { +export default function runJest(dir: string, args: string[]) { const isRelative = dir[0] !== '/'; if (isRelative) { @@ -27,6 +27,7 @@ export default function runJest(dir, args) { the global package.json, which will send Jest into infinite loop. `); } + const result = spawnSync(JEST_PATH, args || [], { cwd: dir, diff --git a/tests/__helpers__/utils.ts b/tests/__helpers__/utils.ts index e122f41d1e..ad2faa980c 100644 --- a/tests/__helpers__/utils.ts +++ b/tests/__helpers__/utils.ts @@ -1,8 +1,5 @@ -import { } from 'jest'; -import { } from 'node'; import * as fs from 'fs'; // from: https://github.com/facebook/jest/blob/master/integration_tests/utils.js -import {sync} from 'cross-spawn'; import {sync as spawnSync} from 'cross-spawn'; import * as path from 'path'; diff --git a/tests/__tests__/babelrc.spec.ts b/tests/__tests__/babelrc.spec.ts new file mode 100644 index 0000000000..bfbbac3ed6 --- /dev/null +++ b/tests/__tests__/babelrc.spec.ts @@ -0,0 +1,20 @@ +import runJest from '../__helpers__/runJest'; + +describe('babelrc flag', () => { + + it('should crash on invalid babelrc', () => { + + const result = runJest('../use-babelrc', ['--no-cache', '-u']); + const stderr = result.stderr.toString(); + expect(result.status).toBe(1); + expect(stderr).toContain('ReferenceError: [BABEL]'); + expect(stderr).toContain('Check out http://babeljs.io/docs/usage/options/ for more information about options.'); + }); + + it('Should not crash on invalid babelrc if useBabelrc is not set', () => { + const result = runJest('../skip-babelrc', ['--no-cache', '-u']); + + expect(result.status).toBe(0); + }); + +}); \ No newline at end of file diff --git a/tests/skip-babelrc/.babelrc b/tests/skip-babelrc/.babelrc new file mode 100644 index 0000000000..f2aed13037 --- /dev/null +++ b/tests/skip-babelrc/.babelrc @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/tests/skip-babelrc/.gitignore b/tests/skip-babelrc/.gitignore new file mode 100644 index 0000000000..9e233d795a --- /dev/null +++ b/tests/skip-babelrc/.gitignore @@ -0,0 +1 @@ +coverage-custom diff --git a/tests/skip-babelrc/Hello.ts b/tests/skip-babelrc/Hello.ts new file mode 100644 index 0000000000..586d0a7118 --- /dev/null +++ b/tests/skip-babelrc/Hello.ts @@ -0,0 +1,21 @@ +export class Hello { + constructor() { + const greeting = ` + this + is + a + multiline + greeting + `; + + this.unexcuted(() => { }); + } + + public unexcuted(action: () => void = () => { }): void { + if (action) { + action(); + } else { + console.log('unexcuted'); + } + } +} \ No newline at end of file diff --git a/tests/skip-babelrc/NullCoverage.js b/tests/skip-babelrc/NullCoverage.js new file mode 100644 index 0000000000..eefe7a0cfb --- /dev/null +++ b/tests/skip-babelrc/NullCoverage.js @@ -0,0 +1,6 @@ +function nullCoverageFunction(value) { + if (value) { + return value; + } + return null; +} \ No newline at end of file diff --git a/tests/skip-babelrc/__tests__/Hello.test.ts b/tests/skip-babelrc/__tests__/Hello.test.ts new file mode 100644 index 0000000000..b2a4ffd0d3 --- /dev/null +++ b/tests/skip-babelrc/__tests__/Hello.test.ts @@ -0,0 +1,10 @@ +import { Hello } from '../Hello'; + +describe('Hello Class', () => { + + it('should throw an error on line 11', () => { + + const hello = new Hello(); + }); + +}); \ No newline at end of file diff --git a/tests/skip-babelrc/package.json b/tests/skip-babelrc/package.json new file mode 100644 index 0000000000..c2d9c1f52b --- /dev/null +++ b/tests/skip-babelrc/package.json @@ -0,0 +1,21 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "coverageReporters": [ + "json" + ], + "collectCoverageFrom": [ + "Hello.ts", + "NullCoverage.js" + ], + "mapCoverage": true, + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + } +} diff --git a/tests/skip-babelrc/tsconfig.json b/tests/skip-babelrc/tsconfig.json new file mode 100644 index 0000000000..55f8667f97 --- /dev/null +++ b/tests/skip-babelrc/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true + } +} diff --git a/tests/use-babelrc/.babelrc b/tests/use-babelrc/.babelrc new file mode 100644 index 0000000000..f2aed13037 --- /dev/null +++ b/tests/use-babelrc/.babelrc @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/tests/use-babelrc/.gitignore b/tests/use-babelrc/.gitignore new file mode 100644 index 0000000000..9e233d795a --- /dev/null +++ b/tests/use-babelrc/.gitignore @@ -0,0 +1 @@ +coverage-custom diff --git a/tests/use-babelrc/Hello.ts b/tests/use-babelrc/Hello.ts new file mode 100644 index 0000000000..c2dfee9115 --- /dev/null +++ b/tests/use-babelrc/Hello.ts @@ -0,0 +1,23 @@ +export class Hello { + constructor() { + const greeting = ` + this + is + a + multiline + greeting + `; + + this.unexcuted(() => { }); + + throw new Error('Hello error!'); + } + + public unexcuted(action: () => void = () => { }): void { + if (action) { + action(); + } else { + console.log('unexcuted'); + } + } +} \ No newline at end of file diff --git a/tests/use-babelrc/NullCoverage.js b/tests/use-babelrc/NullCoverage.js new file mode 100644 index 0000000000..eefe7a0cfb --- /dev/null +++ b/tests/use-babelrc/NullCoverage.js @@ -0,0 +1,6 @@ +function nullCoverageFunction(value) { + if (value) { + return value; + } + return null; +} \ No newline at end of file diff --git a/tests/use-babelrc/__tests__/Hello.test.ts b/tests/use-babelrc/__tests__/Hello.test.ts new file mode 100644 index 0000000000..a7bf3613b5 --- /dev/null +++ b/tests/use-babelrc/__tests__/Hello.test.ts @@ -0,0 +1,11 @@ +import { Hello } from '../Hello'; + +describe('Hello Class', () => { + + it('should throw an error on line 11', () => { + + const hello = new Hello(); + + }); + +}); \ No newline at end of file diff --git a/tests/use-babelrc/package.json b/tests/use-babelrc/package.json new file mode 100644 index 0000000000..2e4f78a72a --- /dev/null +++ b/tests/use-babelrc/package.json @@ -0,0 +1,22 @@ +{ + "jest": { + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "moduleDirectories": [ + "node_modules", + "src" + ], + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ], + "globals": { + "ts-jest": { + "useBabelrc": true + } + } + } +} diff --git a/tests/use-babelrc/tsconfig.json b/tests/use-babelrc/tsconfig.json new file mode 100644 index 0000000000..55f8667f97 --- /dev/null +++ b/tests/use-babelrc/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true + } +} diff --git a/yarn.lock b/yarn.lock index 457b785afa..37c69e102b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2530,7 +2530,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -typescript@2.4.1: +typescript@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc" From d096dece57c2b6259a5bf78b2909092f6c88fdeb Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Thu, 6 Jul 2017 14:12:06 +0530 Subject: [PATCH 227/256] Add missing semi-colons and new line at the end --- src/jest-types.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jest-types.ts b/src/jest-types.ts index 1c14f0ecdc..a3c6c74719 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -19,11 +19,11 @@ export type HasteConfig = { export interface BabelTransformOptions extends BabelTransformOpts{ cacheDirectory?: string; -} +}; export interface PostProcessHook { (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions): string; -} +}; export type JestConfig = Partial; @@ -66,4 +66,5 @@ export type FullJestConfig = { export interface TsJestConfig { skipBabel?: boolean; useBabelrc?: boolean; -} \ No newline at end of file +}; + From ae776bccfb92b81bc3987768bb1d3ead44d85659 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 14:15:02 +0530 Subject: [PATCH 228/256] Move comments with the code --- src/preprocessor.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/preprocessor.ts b/src/preprocessor.ts index 9b90082636..d89071da4f 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -12,19 +12,19 @@ export function process( path: Path, config: JestConfig, transformOptions: TransformOptions = { instrument: false }) { - + + // transformOptions.instrument is a proxy for collectCoverage + // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 const compilerOptions = getTSConfig(config.globals, transformOptions.instrument); const tsJestConfig = getTSJestConfig(config.globals); - + const root = pkgDir.sync(); - // transformOptions.instrument is a proxy for collectCoverage - // https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902 const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx'); const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); - - + + let postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { From eddecaafb91c9706095b583b10af5799a134741d Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 14:16:19 +0530 Subject: [PATCH 229/256] Fix formatting --- src/jest-types.ts | 12 ++++++------ tests/skip-babelrc/.babelrc | 2 +- tests/skip-babelrc/Hello.ts | 2 +- tests/skip-babelrc/NullCoverage.js | 2 +- tests/skip-babelrc/__tests__/Hello.test.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/jest-types.ts b/src/jest-types.ts index a3c6c74719..d94ac36702 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -1,13 +1,13 @@ import { TransformOptions as BabelTransformOpts } from 'babel-core'; export interface TransformOptions { instrument: boolean; -} +}; export type Path = string; export type Glob = string; -export type ConfigGlobals = { [key: string]: any}; +export type ConfigGlobals = { [key: string]: any }; export type HasteConfig = { defaultPlatform?: string | null; @@ -17,7 +17,7 @@ export type HasteConfig = { }; -export interface BabelTransformOptions extends BabelTransformOpts{ +export interface BabelTransformOptions extends BabelTransformOpts { cacheDirectory?: string; }; @@ -64,7 +64,7 @@ export type FullJestConfig = { }; export interface TsJestConfig { - skipBabel?: boolean; - useBabelrc?: boolean; + skipBabel?: boolean; + useBabelrc?: boolean; }; - + diff --git a/tests/skip-babelrc/.babelrc b/tests/skip-babelrc/.babelrc index f2aed13037..460b5331d2 100644 --- a/tests/skip-babelrc/.babelrc +++ b/tests/skip-babelrc/.babelrc @@ -1,3 +1,3 @@ { "foo": "bar" -} \ No newline at end of file +} diff --git a/tests/skip-babelrc/Hello.ts b/tests/skip-babelrc/Hello.ts index 586d0a7118..2fec0b9d74 100644 --- a/tests/skip-babelrc/Hello.ts +++ b/tests/skip-babelrc/Hello.ts @@ -18,4 +18,4 @@ export class Hello { console.log('unexcuted'); } } -} \ No newline at end of file +} diff --git a/tests/skip-babelrc/NullCoverage.js b/tests/skip-babelrc/NullCoverage.js index eefe7a0cfb..c59dbbdef3 100644 --- a/tests/skip-babelrc/NullCoverage.js +++ b/tests/skip-babelrc/NullCoverage.js @@ -3,4 +3,4 @@ function nullCoverageFunction(value) { return value; } return null; -} \ No newline at end of file +} diff --git a/tests/skip-babelrc/__tests__/Hello.test.ts b/tests/skip-babelrc/__tests__/Hello.test.ts index b2a4ffd0d3..c1bda7d29a 100644 --- a/tests/skip-babelrc/__tests__/Hello.test.ts +++ b/tests/skip-babelrc/__tests__/Hello.test.ts @@ -7,4 +7,4 @@ describe('Hello Class', () => { const hello = new Hello(); }); -}); \ No newline at end of file +}); From 1bbb1e4d74873b30976a2abaee78c901da1334ea Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 14:20:52 +0530 Subject: [PATCH 230/256] Add missing last lines --- tests/use-babelrc/.babelrc | 2 +- tests/use-babelrc/Hello.ts | 2 +- tests/use-babelrc/NullCoverage.js | 2 +- tests/use-babelrc/__tests__/Hello.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/use-babelrc/.babelrc b/tests/use-babelrc/.babelrc index f2aed13037..460b5331d2 100644 --- a/tests/use-babelrc/.babelrc +++ b/tests/use-babelrc/.babelrc @@ -1,3 +1,3 @@ { "foo": "bar" -} \ No newline at end of file +} diff --git a/tests/use-babelrc/Hello.ts b/tests/use-babelrc/Hello.ts index c2dfee9115..8c080f9c6a 100644 --- a/tests/use-babelrc/Hello.ts +++ b/tests/use-babelrc/Hello.ts @@ -20,4 +20,4 @@ export class Hello { console.log('unexcuted'); } } -} \ No newline at end of file +} diff --git a/tests/use-babelrc/NullCoverage.js b/tests/use-babelrc/NullCoverage.js index eefe7a0cfb..c59dbbdef3 100644 --- a/tests/use-babelrc/NullCoverage.js +++ b/tests/use-babelrc/NullCoverage.js @@ -3,4 +3,4 @@ function nullCoverageFunction(value) { return value; } return null; -} \ No newline at end of file +} diff --git a/tests/use-babelrc/__tests__/Hello.test.ts b/tests/use-babelrc/__tests__/Hello.test.ts index a7bf3613b5..88dfdaf4e0 100644 --- a/tests/use-babelrc/__tests__/Hello.test.ts +++ b/tests/use-babelrc/__tests__/Hello.test.ts @@ -8,4 +8,4 @@ describe('Hello Class', () => { }); -}); \ No newline at end of file +}); From 41d536c79fba382b73b48117a8af78e57a0f14b7 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 16:13:35 +0530 Subject: [PATCH 231/256] Add initial rules for tslint --- tslint.json | 69 +++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 52 deletions(-) diff --git a/tslint.json b/tslint.json index abf184469d..dacfb6dd90 100644 --- a/tslint.json +++ b/tslint.json @@ -1,54 +1,19 @@ { - "rules": { - "class-name": true, - "forin": true, - "label-position": true, - "label-undefined": true, - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" + "defaultSeverity": "warning", + "extends": [ + "tslint:recommended" ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": false, - "no-eval": true, - "no-switch-case-fall-through": true, - "no-unused-expression": true, - "no-unused-variable": [ - true, - "react" - ], - "no-unreachable": true, - "no-use-before-declare": true, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else" - ], - "quotemark": [ - true, - "single", - "jsx-double" - ], - "radix": true, - "semicolon": [ - true - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "allow-pascal-case" - ] - } -} \ No newline at end of file + "jsRules": {}, + "rules": { + "quotemark": [ + true, + "single", + "jsx-double" + ], + "semicolon": [ + true, + "always" + ] + }, + "rulesDirectory": [] +} From 1cd9a524947fe641d7de05de98d210eb5fcf5541 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 16:13:51 +0530 Subject: [PATCH 232/256] Autofix tslint errors --- src/default-retrieve-file-handler.ts | 6 ++-- src/index.ts | 4 +-- src/jest-types.ts | 50 +++++++++++++--------------- src/postprocess.ts | 19 +++++------ src/preprocessor.ts | 21 ++++++------ src/transpile-if-ts.ts | 6 ++-- src/utils.ts | 14 ++++---- 7 files changed, 57 insertions(+), 63 deletions(-) diff --git a/src/default-retrieve-file-handler.ts b/src/default-retrieve-file-handler.ts index af3b5f44b3..d85d9f1c72 100644 --- a/src/default-retrieve-file-handler.ts +++ b/src/default-retrieve-file-handler.ts @@ -6,12 +6,12 @@ export function defaultRetrieveFileHandler(path) { path = path.trim(); // This was removed because it seems that we can't use cache while expecting correct results - // TODO: check correctness and performance with file caching + // TODO: check correctness and performance with file caching // if (path in fileContentsCache) { // return fileContentsCache[path]; // } - var contents: string; + let contents: string; try { contents = fs.readFileSync(path, 'utf8'); contents = transpileIfTypescript(path, contents); @@ -20,4 +20,4 @@ export function defaultRetrieveFileHandler(path) { } return contents; -} \ No newline at end of file +} diff --git a/src/index.ts b/src/index.ts index 338a527f4c..8894a345b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ -import { defaultRetrieveFileHandler } from './default-retrieve-file-handler'; import * as sourceMapSupport from 'source-map-support'; +import { defaultRetrieveFileHandler } from './default-retrieve-file-handler'; export { transpileIfTypescript } from './transpile-if-ts'; export function install() { - var options: sourceMapSupport.Options = {}; + let options: sourceMapSupport.Options = {}; options.retrieveFile = defaultRetrieveFileHandler; options.emptyCacheBetweenOperations = true; // left here only for sourceMapCache TODO: check this for correctness and performance with false velue options['environment'] = 'node'; diff --git a/src/jest-types.ts b/src/jest-types.ts index d94ac36702..6d3ce0336b 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -1,70 +1,66 @@ import { TransformOptions as BabelTransformOpts } from 'babel-core'; export interface TransformOptions { instrument: boolean; -}; +} export type Path = string; export type Glob = string; -export type ConfigGlobals = { [key: string]: any }; +export interface ConfigGlobals { [key: string]: any; } -export type HasteConfig = { +export interface HasteConfig { defaultPlatform?: string | null; hasteImplModulePath?: string; - platforms?: Array; - providesModuleNodeModules: Array; -}; - + platforms?: string[]; + providesModuleNodeModules: string[]; +} export interface BabelTransformOptions extends BabelTransformOpts { cacheDirectory?: string; -}; +} -export interface PostProcessHook { - (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions): string; -}; +export type PostProcessHook = (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions) => string; export type JestConfig = Partial; -export type FullJestConfig = { +export interface FullJestConfig { automock: boolean; browser: boolean; cache: boolean; cacheDirectory: Path; clearMocks: boolean; - coveragePathIgnorePatterns: Array; + coveragePathIgnorePatterns: string[]; globals: ConfigGlobals; haste: HasteConfig; - moduleDirectories: Array; - moduleFileExtensions: Array; + moduleDirectories: string[]; + moduleFileExtensions: string[]; moduleLoader: Path; moduleNameMapper: Array<[string, string]>; - modulePathIgnorePatterns: Array; - modulePaths: Array; + modulePathIgnorePatterns: string[]; + modulePaths: string[]; name: string; resetMocks: boolean; resetModules: boolean; resolver: Path | null; rootDir: Path; - roots: Array; - setupFiles: Array; + roots: Path[]; + setupFiles: Path[]; setupTestFrameworkScriptFile: Path; - snapshotSerializers: Array; + snapshotSerializers: Path[]; testEnvironment: string; - testMatch: Array; - testPathIgnorePatterns: Array; + testMatch: Glob[]; + testPathIgnorePatterns: string[]; testRegex: string; testRunner: string; testURL: string; timers: 'real' | 'fake'; transform: Array<[string, Path]>; - transformIgnorePatterns: Array; - unmockedModulePathPatterns: Array | null; -}; + transformIgnorePatterns: Glob[]; + unmockedModulePathPatterns: string[] | null; +} export interface TsJestConfig { skipBabel?: boolean; useBabelrc?: boolean; -}; - +} diff --git a/src/postprocess.ts b/src/postprocess.ts index 5b6ea938c1..e526792779 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -2,11 +2,11 @@ * Postprocess step. Based on babel-jest: https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js * https://github.com/facebook/jest/blob/9b157c3a7c325c3971b2aabbe4c8ab4ce0b0c56d/packages/babel-jest/src/index.js */ -import * as jestPreset from 'babel-preset-jest'; -import { BabelTransformOptions, JestConfig, PostProcessHook, TransformOptions, TsJestConfig } from './jest-types'; import * as babel from 'babel-core'; -import { CompilerOptions } from 'typescript/lib/typescript'; import istanbulPlugin from 'babel-plugin-istanbul'; +import * as jestPreset from 'babel-preset-jest'; +import { CompilerOptions } from 'typescript/lib/typescript'; +import { BabelTransformOptions, JestConfig, PostProcessHook, TransformOptions, TsJestConfig, FullJestConfig } from './jest-types'; function createBabelTransformer(options: BabelTransformOptions) { options = { @@ -16,13 +16,13 @@ function createBabelTransformer(options: BabelTransformOptions) { // If retainLines isn't set to true, the line numbers // are off by 1 retainLines: true, - // force the sourceMaps property to be 'inline' during testing - // to help generate accurate sourcemaps. - sourceMaps: 'inline' + // force the sourceMaps property to be 'inline' during testing + // to help generate accurate sourcemaps. + sourceMaps: 'inline', }; delete options.cacheDirectory; delete options.filename; - + return (src: string, filename: string, config: JestConfig, @@ -58,10 +58,9 @@ export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfi plugins.push('transform-es2015-modules-commonjs'); } - return createBabelTransformer({ presets: [], - plugins: plugins, - babelrc: tsJestConfig.useBabelrc || false + plugins, + babelrc: tsJestConfig.useBabelrc || false, }); }; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index d89071da4f..ad8dd54aec 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -1,11 +1,11 @@ -import * as fs from 'fs-extra'; import * as crypto from 'crypto'; -import * as tsc from 'typescript'; -import { getTSConfig, getTSJestConfig } from './utils'; +import * as fs from 'fs-extra'; import * as nodepath from 'path'; -import { TransformOptions, Path, JestConfig } from './jest-types'; -import { getPostProcessHook } from './postprocess'; import * as pkgDir from 'pkg-dir'; +import * as tsc from 'typescript'; +import { JestConfig, Path, TransformOptions } from './jest-types'; +import { getPostProcessHook } from './postprocess'; +import { getTSConfig, getTSJestConfig } from './utils'; export function process( src: string, @@ -24,8 +24,7 @@ export function process( const isJsFile = path.endsWith('.js') || path.endsWith('.jsx'); const isHtmlFile = path.endsWith('.html'); - - let postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); + const postHook = getPostProcessHook(compilerOptions, config, tsJestConfig); if (isHtmlFile && config.globals.__TRANSFORM_HTML__) { src = 'module.exports=`' + src + '`;'; @@ -39,16 +38,16 @@ export function process( const tsTranspiled = tsc.transpileModule( src, { - compilerOptions: compilerOptions, - fileName: path - } + compilerOptions, + fileName: path, + }, ); const outputText = postHook( tsTranspiled.outputText, path, config, - transformOptions + transformOptions, ); // strip root part from path diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index f7cbd2afc7..fd980e4477 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -4,12 +4,12 @@ import { getTSConfig } from './utils'; export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { - let transpiled = tsc.transpileModule(contents, { + const transpiled = tsc.transpileModule(contents, { compilerOptions: getTSConfig(config || { __TS_CONFIG__: global['__TS_CONFIG__'] }, true), - fileName: path + fileName: path, }); return transpiled.outputText; } return contents; -} \ No newline at end of file +} diff --git a/src/utils.ts b/src/utils.ts index b25ad40f22..86d3d094af 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,7 @@ -import * as tsc from 'typescript'; -import * as path from 'path'; import * as fs from 'fs'; -import {normalize} from 'jest-config'; +import { normalize } from 'jest-config'; +import * as path from 'path'; +import * as tsc from 'typescript'; import { TsJestConfig } from './jest-types'; const setFromArgv = require('jest-config/build/setFromArgv'); // import * as setFromArgv from 'jest-config/build/setfromArgv'; @@ -25,7 +25,7 @@ function loadJestConfigFromFile(filePath, argv) { } function loadJestConfigFromPackage(filePath, argv) { - const R_OK = fs.constants && fs.constants.R_OK || fs['R_OK']; + const R_OK = fs.constants && fs.constants.R_OK || fs['R_OK'] as number; try { fs.accessSync(filePath, R_OK); } catch (e) { @@ -63,17 +63,17 @@ export function getJestConfig(root) { return Object.freeze(setFromArgv(rawConfig, argv)); } -export function getTSJestConfig(globals: any) : TsJestConfig { +export function getTSJestConfig(globals: any): TsJestConfig { return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; } function formatTscParserErrors(errors: tsc.Diagnostic[]) { - return errors.map(s => JSON.stringify(s, null, 4)).join('\n'); + return errors.map((s) => JSON.stringify(s, null, 4)).join('\n'); } function readCompilerOptions(configPath: string) { // First step: Let tsc pick up the config. - const loaded = tsc.readConfigFile(configPath, file => { + const loaded = tsc.readConfigFile(configPath, (file) => { const read = tsc.sys.readFile(file); // See https://github.com/Microsoft/TypeScript/blob/a757e8428410c2196886776785c16f8f0c2a62d9/src/compiler/sys.ts#L203 : // `readFile` returns `undefined` in case the file does not exist! From 7a5f070a5b2e2218969a7415c87c2ca134644fd4 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 16:36:45 +0530 Subject: [PATCH 233/256] Add rule to not start interface names with I --- tslint.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tslint.json b/tslint.json index dacfb6dd90..309216d9e9 100644 --- a/tslint.json +++ b/tslint.json @@ -1,9 +1,8 @@ { - "defaultSeverity": "warning", + "defaultSeverity": "error", "extends": [ "tslint:recommended" ], - "jsRules": {}, "rules": { "quotemark": [ true, @@ -13,7 +12,10 @@ "semicolon": [ true, "always" + ], + "interface-name": [ + true, + "never-prefix" ] - }, - "rulesDirectory": [] + } } From 05899c86175cc0ed716ce08b2426b183639110d6 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 16:38:12 +0530 Subject: [PATCH 234/256] Fix tslint errors --- src/index.ts | 11 +++++++++-- src/jest-types.ts | 7 ++++++- src/postprocess.ts | 27 ++++++++++++++++++++------- src/preprocessor.ts | 8 ++++++-- src/transpile-if-ts.ts | 2 ++ src/utils.ts | 9 +++++++-- 6 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8894a345b6..48def9e083 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,10 +3,17 @@ import { defaultRetrieveFileHandler } from './default-retrieve-file-handler'; export { transpileIfTypescript } from './transpile-if-ts'; export function install() { - let options: sourceMapSupport.Options = {}; + const options: sourceMapSupport.Options = {}; options.retrieveFile = defaultRetrieveFileHandler; - options.emptyCacheBetweenOperations = true; // left here only for sourceMapCache TODO: check this for correctness and performance with false velue + options.emptyCacheBetweenOperations = true; // left here only for + // sourceMapCache TODO: check this for correctness and performance with + // false value + + /* tslint:disable */ + // disabling tslint because the types for the source-map-support version + // in use here don't have the 'environment' property on options options['environment'] = 'node'; + /* tslint:disable */ return sourceMapSupport.install(options); } diff --git a/src/jest-types.ts b/src/jest-types.ts index 6d3ce0336b..905bed0365 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -1,4 +1,5 @@ import { TransformOptions as BabelTransformOpts } from 'babel-core'; + export interface TransformOptions { instrument: boolean; } @@ -20,7 +21,11 @@ export interface BabelTransformOptions extends BabelTransformOpts { cacheDirectory?: string; } -export type PostProcessHook = (src: string, filename: string, config: JestConfig, transformOptions: TransformOptions) => string; +export type PostProcessHook = ( + src: string, + filename: string, + config: JestConfig, + transformOptions: TransformOptions) => string; export type JestConfig = Partial; diff --git a/src/postprocess.ts b/src/postprocess.ts index e526792779..326b49d6ba 100644 --- a/src/postprocess.ts +++ b/src/postprocess.ts @@ -6,7 +6,14 @@ import * as babel from 'babel-core'; import istanbulPlugin from 'babel-plugin-istanbul'; import * as jestPreset from 'babel-preset-jest'; import { CompilerOptions } from 'typescript/lib/typescript'; -import { BabelTransformOptions, JestConfig, PostProcessHook, TransformOptions, TsJestConfig, FullJestConfig } from './jest-types'; +import { + BabelTransformOptions, + FullJestConfig, + JestConfig, + PostProcessHook, + TransformOptions, + TsJestConfig, +} from './jest-types'; function createBabelTransformer(options: BabelTransformOptions) { options = { @@ -23,10 +30,12 @@ function createBabelTransformer(options: BabelTransformOptions) { delete options.cacheDirectory; delete options.filename; - return (src: string, + return ( + src: string, filename: string, config: JestConfig, transformOptions: TransformOptions): string => { + const theseOptions = Object.assign({ filename }, options); if (transformOptions && transformOptions.instrument) { theseOptions.auxiliaryCommentBefore = ' istanbul ignore next '; @@ -47,20 +56,24 @@ function createBabelTransformer(options: BabelTransformOptions) { }; } -export const getPostProcessHook = (tsCompilerOptions: CompilerOptions, jestConfig: JestConfig, tsJestConfig: TsJestConfig): PostProcessHook => { +export const getPostProcessHook = ( + tsCompilerOptions: CompilerOptions, + jestConfig: JestConfig, + tsJestConfig: TsJestConfig): PostProcessHook => { + if (tsJestConfig.skipBabel) { - return (src) => src; //Identity function + return (src) => src; // Identity function } const plugins = []; - //If we're not skipping babel + // If we're not skipping babel if (tsCompilerOptions.allowSyntheticDefaultImports) { plugins.push('transform-es2015-modules-commonjs'); } return createBabelTransformer({ - presets: [], - plugins, babelrc: tsJestConfig.useBabelrc || false, + plugins, + presets: [], }); }; diff --git a/src/preprocessor.ts b/src/preprocessor.ts index ad8dd54aec..083dcced98 100644 --- a/src/preprocessor.ts +++ b/src/preprocessor.ts @@ -56,9 +56,13 @@ export function process( // see https://github.com/kulshekhar/ts-jest/issues/158 path = path.startsWith(root) ? path.substr(root.length) : path; - //store transpiled code contains source map into cache, except test cases + // store transpiled code contains source map into cache, except test cases if (!config.testRegex || !path.match(config.testRegex)) { - fs.outputFileSync(nodepath.join(config.cacheDirectory, '/ts-jest/', new Buffer(path).toString('base64')), outputText); + const outputFilePath = nodepath.join( + config.cacheDirectory, '/ts-jest/', + new Buffer(path).toString('base64')); + + fs.outputFileSync(outputFilePath, outputText); } const start = outputText.length > 12 ? outputText.substr(1, 10) : ''; diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index fd980e4477..908a748597 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -5,7 +5,9 @@ export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { const transpiled = tsc.transpileModule(contents, { + /* tslint:disable */ compilerOptions: getTSConfig(config || { __TS_CONFIG__: global['__TS_CONFIG__'] }, true), + /* tslint:enable */ fileName: path, }); diff --git a/src/utils.ts b/src/utils.ts index 86d3d094af..fe57b314b5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,8 +3,10 @@ import { normalize } from 'jest-config'; import * as path from 'path'; import * as tsc from 'typescript'; import { TsJestConfig } from './jest-types'; +/* tslint:disable */ const setFromArgv = require('jest-config/build/setFromArgv'); // import * as setFromArgv from 'jest-config/build/setfromArgv'; +/* tslint:enable */ function parseConfig(argv) { if (argv.config && typeof argv.config === 'string') { @@ -25,7 +27,9 @@ function loadJestConfigFromFile(filePath, argv) { } function loadJestConfigFromPackage(filePath, argv) { + /* tslint:disable */ const R_OK = fs.constants && fs.constants.R_OK || fs['R_OK'] as number; + /* tslint:enable */ try { fs.accessSync(filePath, R_OK); } catch (e) { @@ -75,7 +79,8 @@ function readCompilerOptions(configPath: string) { // First step: Let tsc pick up the config. const loaded = tsc.readConfigFile(configPath, (file) => { const read = tsc.sys.readFile(file); - // See https://github.com/Microsoft/TypeScript/blob/a757e8428410c2196886776785c16f8f0c2a62d9/src/compiler/sys.ts#L203 : + // See + // https://github.com/Microsoft/TypeScript/blob/a757e8428410c2196886776785c16f8f0c2a62d9/src/compiler/sys.ts#L203 : // `readFile` returns `undefined` in case the file does not exist! if (!read) { throw new Error(`ENOENT: no such file or directory, open '${configPath}'`); @@ -124,7 +129,7 @@ export function getTSConfig(globals, collectCoverage: boolean = false) { config.inlineSourceMap = true; } - //inline source with source map for remapping coverage + // inline source with source map for remapping coverage if (collectCoverage) { delete config.sourceMap; From 44b58655df1fdffaf2abb919ae72522ee2c791df Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Thu, 6 Jul 2017 16:49:15 +0530 Subject: [PATCH 235/256] Run tslint in CI --- .travis.yml | 2 +- appveyor.yml | 2 +- package.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1fac720f46..55067d7c8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ node_js: - "6" - "4" before_install: - - npm i -g npm@latest + - npm i -g npm@latest tslint - sudo sysctl fs.inotify.max_user_watches=524288 sudo: required diff --git a/appveyor.yml b/appveyor.yml index cba4dd5486..8579556389 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ install: - ps: Install-Product node $env:nodejs_version - set CI=true - set AppVeyor=true - - npm i -g npm@latest + - npm i -g npm@latest tslint - set PATH=%APPDATA%\npm;%PATH% - npm install diff --git a/package.json b/package.json index 5956a7a24b..d55f7eb3d0 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ "build:watch": "tsc -p . -w", "clean": "rimraf dist/**/* && rimraf tests/simple/coverage/**/* && rimraf tests/simple-async/coverage/**/*", "clean-build": "npm run clean && npm run build", - "pretest": "npm run clean-build", + "pretest": "npm run tslint && npm run clean-build", "test": "node scripts/tests.js", + "tslint": "tslint src/*.ts", "doc": "doctoc .", "prepublish": "npm run clean-build" }, From be0974eecd436b2d544ca216f53e9ee703cce670 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:27:37 +0430 Subject: [PATCH 236/256] Add tsConfigFile & tsConfig parser --- src/utils.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index b25ad40f22..bfc9e1aa9e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,7 +2,6 @@ import * as tsc from 'typescript'; import * as path from 'path'; import * as fs from 'fs'; import {normalize} from 'jest-config'; -import { TsJestConfig } from './jest-types'; const setFromArgv = require('jest-config/build/setFromArgv'); // import * as setFromArgv from 'jest-config/build/setfromArgv'; @@ -63,7 +62,7 @@ export function getJestConfig(root) { return Object.freeze(setFromArgv(rawConfig, argv)); } -export function getTSJestConfig(globals: any) : TsJestConfig { +export function getTSJestConfig(globals) { return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; } @@ -100,8 +99,24 @@ function readCompilerOptions(configPath: string) { return parsedConfig.options; } +export function getTSConfigOptionFromConfig(globals: any) { + if (!globals) return 'tsconfig.json'; + + const tsJestConfig = getTSJestConfig(globals); + + if (('__TS_CONFIG__' in globals) && globals.__TS_CONFIG__) { + return globals.__TS_CONFIG__; + } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { + return tsJestConfig.tsConfigFile; + } else if ('tsConfig' in tsJestConfig && tsJestConfig.tsConfig) { + return tsJestConfig.tsConfig; + } + + return 'tsconfig.json'; +} + export function getTSConfig(globals, collectCoverage: boolean = false) { - let config = (globals && globals.__TS_CONFIG__) ? globals.__TS_CONFIG__ : 'tsconfig.json'; + let config = getTSConfigOptionFromConfig(globals); const skipBabel = getTSJestConfig(globals).skipBabel; const isReferencedExternalFile = typeof config === 'string'; From 6f4fedcd20aa38a6275e5396557d6871cea6753d Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:33:34 +0430 Subject: [PATCH 237/256] Add new schema for config --- src/transpile-if-ts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index f7cbd2afc7..d8a094980d 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -1,15 +1,15 @@ import * as tsc from 'typescript'; -import { getTSConfig } from './utils'; +import { getTSConfigOptionFromConfig, getTSConfig } from './utils'; export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { let transpiled = tsc.transpileModule(contents, { - compilerOptions: getTSConfig(config || { __TS_CONFIG__: global['__TS_CONFIG__'] }, true), + compilerOptions: getTSConfig(config || { 'ts-jest': { tsConfigFile: getTSConfigOptionFromConfig(global) }}, true), fileName: path }); return transpiled.outputText; } return contents; -} \ No newline at end of file +} From dca97cd419e136130f0ba64d3c294e7d2c3d8bd3 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:33:58 +0430 Subject: [PATCH 238/256] Add ts config schema maker --- src/utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index bfc9e1aa9e..b863c1b094 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -115,6 +115,13 @@ export function getTSConfigOptionFromConfig(globals: any) { return 'tsconfig.json'; } +export function mockGlobalTSConfigSchema(globals: any) { + const config = getTSConfigOptionFromConfig(globals); + return typeof config === 'string' ? + { 'ts-jest': { tsConfigFile: config }} : + { 'ts-jest': { tsConfig: config }}; +} + export function getTSConfig(globals, collectCoverage: boolean = false) { let config = getTSConfigOptionFromConfig(globals); const skipBabel = getTSJestConfig(globals).skipBabel; From 4ae283f97196757716c897c67d99fe4a10bdd848 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:34:19 +0430 Subject: [PATCH 239/256] Add new config schema --- src/transpile-if-ts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index d8a094980d..d4b07704b9 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -1,11 +1,11 @@ import * as tsc from 'typescript'; -import { getTSConfigOptionFromConfig, getTSConfig } from './utils'; +import { mockGlobalTSConfigSchema, getTSConfigOptionFromConfig, getTSConfig } from './utils'; export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { - + let transpiled = tsc.transpileModule(contents, { - compilerOptions: getTSConfig(config || { 'ts-jest': { tsConfigFile: getTSConfigOptionFromConfig(global) }}, true), + compilerOptions: getTSConfig(config || mockGlobalTSConfigSchema(global), true), fileName: path }); From c14f81623dc8959ebace503f62f289fc11b80fce Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:37:40 +0430 Subject: [PATCH 240/256] Add new config schema tests --- tests/__tests__/transpile-if-ts.spec.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/__tests__/transpile-if-ts.spec.ts b/tests/__tests__/transpile-if-ts.spec.ts index 3d9337c56e..c366118ebc 100644 --- a/tests/__tests__/transpile-if-ts.spec.ts +++ b/tests/__tests__/transpile-if-ts.spec.ts @@ -11,9 +11,15 @@ describe('transpileIfTypescript', () => { expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";'); }); + it('should be possible to pass a custom config (Deprecated)', () => { + const customTsConfigFile = 'not-existant.json'; + const customConfig = { __TS_CONFIG__: customTsConfigFile }; + expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile)); + }); + it('should be possible to pass a custom config', () => { const customTsConfigFile = 'not-existant.json'; - const customConfig = { __TS_CONFIG__: customTsConfigFile}; + const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile }}; expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile)); }); }); From 8f778c4e7d1aefe885a887646ec6f66b20a4b711 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:40:46 +0430 Subject: [PATCH 241/256] Add tests for tsconfig --- tests/__tests__/tsconfig-comments.spec.ts | 53 ++++-- tests/__tests__/tsconfig-default.spec.ts | 129 +++++++++++---- tests/__tests__/tsconfig-inline.spec.ts | 136 +++++++++++---- tests/__tests__/tsconfig-string.spec.ts | 193 ++++++++++++++++------ 4 files changed, 382 insertions(+), 129 deletions(-) diff --git a/tests/__tests__/tsconfig-comments.spec.ts b/tests/__tests__/tsconfig-comments.spec.ts index 3291eb6940..11561c55b2 100644 --- a/tests/__tests__/tsconfig-comments.spec.ts +++ b/tests/__tests__/tsconfig-comments.spec.ts @@ -33,22 +33,53 @@ describe('parse tsconfig with comments', () => { }); - it('one config file should extend the other', () => { - const config = getTSConfig({ - __TS_CONFIG__: 'allows-comments.json' + describe('old behaviour (__TS_CONFIG__)', () => { + + it('one config file should extend the other', () => { + const config = getTSConfig({ + __TS_CONFIG__: '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); + }); + + it('should correctly read allow-comments.json', () => { + expect(() => { + getTSConfig({ + '__TS_CONFIG__': 'allows-comments.json' + }); + }).not.toThrow(); }); - // allows-comments.json does not contain a "pretty" field, - // while allows-comments2.json does. Default value would be "false". - expect(config.pretty).toEqual(true); }); + - it('should correctly read allow-comments.json', () => { - expect(() => { - getTSConfig({ - '__TS_CONFIG__': 'allows-comments.json' + describe('new behaviour (tsConfigFile & tsConfig)', () => { + + it('one config file should extend the other', () => { + const config = getTSConfig({ + 'ts-jest': { + tsConfigFile: 'allows-comments.json' + } }); - }).not.toThrow(); + + // allows-comments.json does not contain a "pretty" field, + // while allows-comments2.json does. Default value would be "false". + expect(config.pretty).toEqual(true); + }); + + it('should correctly read allow-comments.json', () => { + expect(() => { + getTSConfig({ + 'ts-jest': { + tsConfigFile: 'allows-comments.json' + } + }); + }).not.toThrow(); + }); + }); }); diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index d0eab11d2c..f05cd5df62 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -47,50 +47,115 @@ describe('get default ts config', () => { }); }); - 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 resultUndefinedContent = getTSConfig({ __TS_CONFIG__: undefined }); - const resultNullContent = getTSConfig({ __TS_CONFIG__: null }); - - expect(result).toEqual(resultUndefinedParam); - expect(result).toEqual(resultNullParam); - expect(result).toEqual(resultEmptyParam); - expect(result).toEqual(resultUndefinedContent); - expect(result).toEqual(resultNullContent); - }); - it('should not change the module if it is loaded from the Jest config global', () => { - const config = getTSConfig({ - '__TS_CONFIG__': { - 'module': 'es2015' - } + describe('old behaviour (__TS_CONFIG__)', () => { + + 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 resultUndefinedContent = getTSConfig({ __TS_CONFIG__: undefined }); + const resultNullContent = getTSConfig({ __TS_CONFIG__: null }); + + expect(result).toEqual(resultUndefinedParam); + expect(result).toEqual(resultNullParam); + expect(result).toEqual(resultEmptyParam); + expect(result).toEqual(resultUndefinedContent); + expect(result).toEqual(resultNullContent); }); - expect(config.module).toBe(ts.ModuleKind.ES2015); - }); + it('should not change the module if it is loaded from the Jest config global', () => { + const config = getTSConfig({ + '__TS_CONFIG__': { + 'module': 'es2015' + } + }); + + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should not change the module if it is loaded from a non-default config file', () => { + const config = getTSConfig({ + '__TS_CONFIG__': 'tsconfig-module/custom-config.json' + }); + + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { + + // set the base directory such that we can use 'tsconfig.json' as the + // config file name instead of 'dir/tsconfig.json' + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + + const config = getTSConfig({ + '__TS_CONFIG__': 'tsconfig.json' + }); - it('should not change the module if it is loaded from a non-default config file', () => { - const config = getTSConfig({ - '__TS_CONFIG__': 'tsconfig-module/custom-config.json' + expect(config.module).toBe(ts.ModuleKind.CommonJS); }); - expect(config.module).toBe(ts.ModuleKind.ES2015); }); - it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { + describe('new behaviour (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 resultUndefinedContent = getTSConfig({ 'ts-jest': { tsConfig: undefined }}); + const resultNullContentFile = getTSConfig({ 'ts-jest': { tsConfigFile: null }}); + const resultNullContent = getTSConfig({ 'ts-jest': { tsConfig: null }}); + + expect(result).toEqual(resultUndefinedParam); + expect(result).toEqual(resultNullParam); + expect(result).toEqual(resultEmptyParam); + expect(result).toEqual(resultUndefinedContentFile); + expect(result).toEqual(resultUndefinedContent); + expect(result).toEqual(resultNullContentFile); + expect(result).toEqual(resultNullContent); + }); - // set the base directory such that we can use 'tsconfig.json' as the - // config file name instead of 'dir/tsconfig.json' - (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + it('should not change the module if it is loaded from the Jest config global', () => { + const config = getTSConfig({ + 'ts-jest': { + tsConfig: { + 'module': 'es2015' + } + } + }); + + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should not change the module if it is loaded from a non-default config file', () => { + const config = getTSConfig({ + 'ts-jest': { + 'tsConfigFile': 'tsconfig-module/custom-config.json' + } + }); + + expect(config.module).toBe(ts.ModuleKind.ES2015); + }); + + it('should set the module to CommonJS if it is not, when loading from the default tsconfig file', () => { + + // set the base directory such that we can use 'tsconfig.json' as the + // config file name instead of 'dir/tsconfig.json' + (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test/tsconfig-module'); + + const config = getTSConfig({ + 'ts-jest': { + 'tsConfigFile': 'tsconfig.json' + } + }); - const config = getTSConfig({ - '__TS_CONFIG__': 'tsconfig.json' + expect(config.module).toBe(ts.ModuleKind.CommonJS); }); - expect(config.module).toBe(ts.ModuleKind.CommonJS); }); it('should correctly read the ts-jest object within jest settings', () => { diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index 157441100d..210b01acb9 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -12,53 +12,117 @@ describe('get inline ts config', () => { (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test'); }); - it('should correctly read inline tsconfig options', () => { - const result = getTSConfig({ - '__TS_CONFIG__': { - 'module': 'commonjs', - 'jsx': 'react' - } - }); + describe('old behaviour (__TS_CONFIG__)', () => { + + it('should correctly read inline tsconfig options', () => { + const result = getTSConfig({ + '__TS_CONFIG__': { + 'module': 'commonjs', + 'jsx': 'react' + } + }); - expect(result).toEqual({ - 'inlineSourceMap': true, - 'module': ts.ModuleKind.CommonJS, - 'jsx': ts.JsxEmit.React + expect(result).toEqual({ + 'inlineSourceMap': true, + 'module': ts.ModuleKind.CommonJS, + 'jsx': ts.JsxEmit.React + }); }); - }); - it('should not read tsconfig.json', () => { - const result = getTSConfig({ - '__TS_CONFIG__': { - 'module': 'commonjs', - 'jsx': 'react' - } + it('should not read tsconfig.json', () => { + const result = getTSConfig({ + '__TS_CONFIG__': { + 'module': 'commonjs', + 'jsx': 'react' + } + }); + + expect(result).not.toEqual({ + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': false, + 'jsx': ts.JsxEmit.React + }); }); - 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 my-tsconfig.json', () => { + const result = getTSConfig({ + '__TS_CONFIG__': { + 'module': 'commonjs', + 'jsx': 'react' + } + }); + + expect(result).not.toEqual({ + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); }); + }); - it('should not read my-tsconfig.json', () => { - const result = getTSConfig({ - '__TS_CONFIG__': { - 'module': 'commonjs', - 'jsx': 'react' - } + + describe('new behaviour (tsConfigFile & tsConfig)', () => { + + it('should correctly read inline tsconfig options', () => { + const result = getTSConfig({ + 'ts-jest': { + tsConfigFile: { + 'module': 'commonjs', + 'jsx': 'react' + } + } + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'module': ts.ModuleKind.CommonJS, + 'jsx': ts.JsxEmit.React + }); }); - expect(result).not.toEqual({ - '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: { + 'module': 'commonjs', + 'jsx': 'react' + } + } + }); + + 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 my-tsconfig.json', () => { + const result = getTSConfig({ + 'ts-jest': { + tsConfigFile: { + 'module': 'commonjs', + 'jsx': 'react' + } + } + }); + + expect(result).not.toEqual({ + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); + }); + }); }); diff --git a/tests/__tests__/tsconfig-string.spec.ts b/tests/__tests__/tsconfig-string.spec.ts index 2ec5dff115..0af014c2d1 100644 --- a/tests/__tests__/tsconfig-string.spec.ts +++ b/tests/__tests__/tsconfig-string.spec.ts @@ -12,78 +12,171 @@ describe('get ts config from string', () => { (path as any).__setBaseDir('./tests/tsconfig-test'); }); - it('should correctly read my-tsconfig.json', () => { - const result = getTSConfig({ - '__TS_CONFIG__': 'my-tsconfig.json' + describe('old behaviour (__TS_CONFIG__)', () => { + + it('should correctly read my-tsconfig.json', () => { + const result = getTSConfig({ + '__TS_CONFIG__': 'my-tsconfig.json' + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); }); - expect(result).toEqual({ - 'inlineSourceMap': 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', () => { - it('should not read tsconfig.json', () => { + const result = getTSConfig({ + '__TS_CONFIG__': 'my-tsconfig.json' + }); - const result = getTSConfig({ - '__TS_CONFIG__': '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 + }); }); - 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_CONFIG__': 'my-tsconfig.json' + }); + + expect(result).not.toEqual({ + 'target': ts.ScriptTarget.ES5, + 'jsx': ts.JsxEmit.React + }); }); - }); - it('should not read inline tsconfig options', () => { + it('should correctly resolve the "extends" directive', () => { + + const result = getTSConfig({ + '__TS_CONFIG__': 'extends-tsconfig.json' + }); - const result = getTSConfig({ - '__TS_CONFIG__': 'my-tsconfig.json' + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); }); - expect(result).not.toEqual({ - 'target': ts.ScriptTarget.ES5, - 'jsx': ts.JsxEmit.React + it('should correctly override any config in the "extends" directive', () => { + const result = getTSConfig({ + '__TS_CONFIG__': 'extends-with-overrides-tsconfig.json' + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES5, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React, + 'noImplicitAny': true + }); }); + }); - it('should correctly resolve the "extends" directive', () => { - const result = getTSConfig({ - '__TS_CONFIG__': 'extends-tsconfig.json' + describe('new behaviour (tsConfigFile & tsConfig)', () => { + + it('should correctly read my-tsconfig.json', () => { + const result = getTSConfig({ + 'ts-jest': { + tsConfigFile: 'my-tsconfig.json' + } + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); }); - expect(result).toEqual({ - 'inlineSourceMap': 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' + } + }); + + expect(result).not.toEqual({ + 'target': ts.ScriptTarget.ES5, + 'jsx': ts.JsxEmit.React + }); }); - }); - it('should correctly override any config in the "extends" directive', () => { - const result = getTSConfig({ - '__TS_CONFIG__': 'extends-with-overrides-tsconfig.json' + it('should correctly resolve the "extends" directive', () => { + + const result = getTSConfig({ + 'ts-jest': { + tsConfigFile: 'extends-tsconfig.json' + } + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES2015, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React + }); }); - expect(result).toEqual({ - 'inlineSourceMap': true, - 'target': ts.ScriptTarget.ES5, - 'module': ts.ModuleKind.CommonJS, - 'moduleResolution': ts.ModuleResolutionKind.NodeJs, - 'noEmitOnError': true, - 'jsx': ts.JsxEmit.React, - 'noImplicitAny': true + it('should correctly override any config in the "extends" directive', () => { + const result = getTSConfig({ + 'ts-jest': { + tsConfigFile: 'extends-with-overrides-tsconfig.json' + } + }); + + expect(result).toEqual({ + 'inlineSourceMap': true, + 'target': ts.ScriptTarget.ES5, + 'module': ts.ModuleKind.CommonJS, + 'moduleResolution': ts.ModuleResolutionKind.NodeJs, + 'noEmitOnError': true, + 'jsx': ts.JsxEmit.React, + 'noImplicitAny': true + }); }); + }); }); From 01ef29bbd48f6ad58eedba171fab55a961091a63 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:44:14 +0430 Subject: [PATCH 242/256] Add depracted __TS_CONFIG__ warning --- src/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.ts b/src/utils.ts index b863c1b094..909f8691cd 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -105,6 +105,7 @@ export function getTSConfigOptionFromConfig(globals: any) { const tsJestConfig = getTSJestConfig(globals); if (('__TS_CONFIG__' in globals) && globals.__TS_CONFIG__) { + console.warn('Using globals > __TS_CONFIG__ option for setting TS config is deprecated. Please set config using this option: globals > ts-jest > tsConfig (object) or tsConfigFile (string). More information at https://github.com/kulshekhar/ts-jest#tsconfig'); return globals.__TS_CONFIG__; } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; From f5fa4434e449f5e35073882e4df41c717ca47fe0 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 18:49:32 +0430 Subject: [PATCH 243/256] Add documention for new tsConfig --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c3021956b..4daef8d9a2 100644 --- a/README.md +++ b/README.md @@ -114,13 +114,15 @@ If the default setup doesn't address your requirements, you can create a custom By default this package will try to locate `tsconfig.json` and use its compiler options for your `.ts` and `.tsx` files. You can override this behaviour by pointing ts-jest to a custom TypeScript configuration file. -You can do this by setting the `__TS_CONFIG__` option in globals for jest to the path of the -custom configuration file (relative to the project's root directory)```json -``` +You can do this by setting the `tsConfigFile` option in your global variables under the `ts-jest` key to path of the +custom configuration file (relative to the project's root directory) (__TS_CONFIG__ is deprecated) +```json { "jest": { "globals": { - "__TS_CONFIG__": "my-tsconfig.json" + "ts-jest": { + "tsConfigFile": "my-tsconfig.json" + } } } } @@ -130,17 +132,21 @@ Or even declare options for `tsc` instead of using separate config, like this: { "jest": { "globals": { - "__TS_CONFIG__": { - "module": "commonjs", - "jsx": "react" + "ts-jest": { + "tsConfig": { + "module": "commonjs", + "jsx": "react" + } } } } } ``` +**Warning: Using __TS_CONFIG__ option in globals is deprecated and soon will be removed.** + For all available `tsc` options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). -Note that if you haven't explicitly set the `module` property in the `__TS_CONFIG__` setting (either directly or through a separate configuration file), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. +Note that if you haven't explicitly set the `module` property in the `tsConfig` setting (either directly or through a separate configuration file with `tsConfigFile`), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. ### Skipping Babel If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step. From 9875b382e2a7aad79c742308948c21141d96482f Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 20:58:02 +0430 Subject: [PATCH 244/256] Fix tslint error --- src/utils.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index bba088ed23..bc0c65d2bc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -68,11 +68,7 @@ export function getJestConfig(root) { return Object.freeze(setFromArgv(rawConfig, argv)); } -<<<<<<< HEAD -export function getTSJestConfig(globals) { -======= export function getTSJestConfig(globals: any): TsJestConfig { ->>>>>>> f7b8313 return (globals && globals['ts-jest']) ? globals['ts-jest'] : {}; } From d19513058be5f3829d87f43916bf70803cbb53ee Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 21:01:17 +0430 Subject: [PATCH 245/256] Update __TS_CONFIG__ warning --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index bc0c65d2bc..877bc90438 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -112,7 +112,7 @@ export function getTSConfigOptionFromConfig(globals: any) { const tsJestConfig = getTSJestConfig(globals); if (('__TS_CONFIG__' in globals) && globals.__TS_CONFIG__) { - console.warn('Using globals > __TS_CONFIG__ option for setting TS config is deprecated. Please set config using this option: globals > ts-jest > tsConfig (object) or tsConfigFile (string). More information at https://github.com/kulshekhar/ts-jest#tsconfig'); + console.warn('Using globals > __TS_CONFIG__ option for setting TS config is deprecated. Please set config using this option:\nglobals > ts-jest > tsConfig (object) or tsConfigFile (string). More information at https://github.com/kulshekhar/ts-jest#tsconfig'); return globals.__TS_CONFIG__; } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; From d4bfff3ea1ac541a6a80b8372f84734e6c447554 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 21:03:59 +0430 Subject: [PATCH 246/256] Remove tsConfig option --- README.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/README.md b/README.md index 4daef8d9a2..bff65db1f0 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ By default this package will try to locate `tsconfig.json` and use its compiler You can override this behaviour by pointing ts-jest to a custom TypeScript configuration file. You can do this by setting the `tsConfigFile` option in your global variables under the `ts-jest` key to path of the -custom configuration file (relative to the project's root directory) (__TS_CONFIG__ is deprecated) +custom configuration file (relative to the project's root directory) *__TS_CONFIG__ is deprecated* ```json { "jest": { @@ -127,21 +127,6 @@ custom configuration file (relative to the project's root directory) (__TS_CONFI } } ``` -Or even declare options for `tsc` instead of using separate config, like this: -```json -{ - "jest": { - "globals": { - "ts-jest": { - "tsConfig": { - "module": "commonjs", - "jsx": "react" - } - } - } - } -} -``` **Warning: Using __TS_CONFIG__ option in globals is deprecated and soon will be removed.** For all available `tsc` options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). From 33bf5b9ed4c6167dc814cb6ee2216076d8c26fa0 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 21:04:05 +0430 Subject: [PATCH 247/256] Remove tsConfig option --- src/utils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 877bc90438..2f81232147 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -116,8 +116,6 @@ export function getTSConfigOptionFromConfig(globals: any) { return globals.__TS_CONFIG__; } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; - } else if ('tsConfig' in tsJestConfig && tsJestConfig.tsConfig) { - return tsJestConfig.tsConfig; } return 'tsconfig.json'; @@ -127,7 +125,7 @@ export function mockGlobalTSConfigSchema(globals: any) { const config = getTSConfigOptionFromConfig(globals); return typeof config === 'string' ? { 'ts-jest': { tsConfigFile: config }} : - { 'ts-jest': { tsConfig: config }}; + { __TS_CONFIG__: config }}; } export function getTSConfig(globals, collectCoverage: boolean = false) { From f065714f6381274eabf5df1fbac1671cdb9f307b Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Thu, 6 Jul 2017 21:06:52 +0430 Subject: [PATCH 248/256] Remove tsConfig related tests --- tests/__tests__/tsconfig-default.spec.ts | 16 ------ tests/__tests__/tsconfig-inline.spec.ts | 62 +----------------------- 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index f05cd5df62..b2fec46fb8 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -106,29 +106,13 @@ describe('get default ts config', () => { const resultNullParam = getTSConfig(null); const resultEmptyParam = getTSConfig({}); const resultUndefinedContentFile = getTSConfig({ 'ts-jest': { tsConfigFile: undefined }}); - const resultUndefinedContent = getTSConfig({ 'ts-jest': { tsConfig: undefined }}); const resultNullContentFile = getTSConfig({ 'ts-jest': { tsConfigFile: null }}); - const resultNullContent = getTSConfig({ 'ts-jest': { tsConfig: null }}); expect(result).toEqual(resultUndefinedParam); expect(result).toEqual(resultNullParam); expect(result).toEqual(resultEmptyParam); expect(result).toEqual(resultUndefinedContentFile); - expect(result).toEqual(resultUndefinedContent); expect(result).toEqual(resultNullContentFile); - expect(result).toEqual(resultNullContent); - }); - - it('should not change the module if it is loaded from the Jest config global', () => { - const config = getTSConfig({ - 'ts-jest': { - tsConfig: { - 'module': 'es2015' - } - } - }); - - expect(config.module).toBe(ts.ModuleKind.ES2015); }); it('should not change the module if it is loaded from a non-default config file', () => { diff --git a/tests/__tests__/tsconfig-inline.spec.ts b/tests/__tests__/tsconfig-inline.spec.ts index 210b01acb9..90eabbf4a2 100644 --- a/tests/__tests__/tsconfig-inline.spec.ts +++ b/tests/__tests__/tsconfig-inline.spec.ts @@ -12,7 +12,7 @@ describe('get inline ts config', () => { (path as any as MockedPath).__setBaseDir('./tests/tsconfig-test'); }); - describe('old behaviour (__TS_CONFIG__)', () => { + describe('old behaviour (__TS_CONFIG__) /deprecated/', () => { it('should correctly read inline tsconfig options', () => { const result = getTSConfig({ @@ -65,64 +65,4 @@ describe('get inline ts config', () => { }); - - describe('new behaviour (tsConfigFile & tsConfig)', () => { - - it('should correctly read inline tsconfig options', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: { - 'module': 'commonjs', - 'jsx': 'react' - } - } - }); - - expect(result).toEqual({ - 'inlineSourceMap': true, - 'module': ts.ModuleKind.CommonJS, - 'jsx': ts.JsxEmit.React - }); - }); - - it('should not read tsconfig.json', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: { - 'module': 'commonjs', - 'jsx': 'react' - } - } - }); - - 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 my-tsconfig.json', () => { - const result = getTSConfig({ - 'ts-jest': { - tsConfigFile: { - 'module': 'commonjs', - 'jsx': 'react' - } - } - }); - - expect(result).not.toEqual({ - 'target': ts.ScriptTarget.ES2015, - 'module': ts.ModuleKind.CommonJS, - 'moduleResolution': ts.ModuleResolutionKind.NodeJs, - 'noEmitOnError': true, - 'jsx': ts.JsxEmit.React - }); - }); - - }); - }); From 2cb5f68fb7ca2c6cd05ad28ddc1517e34ebed6f8 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 10:49:29 +0430 Subject: [PATCH 249/256] Fix tslint error --- src/jest-types.ts | 1 + src/transpile-if-ts.ts | 6 +++--- src/utils.ts | 15 +++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/jest-types.ts b/src/jest-types.ts index 905bed0365..6fcccd70e0 100644 --- a/src/jest-types.ts +++ b/src/jest-types.ts @@ -68,4 +68,5 @@ export interface FullJestConfig { export interface TsJestConfig { skipBabel?: boolean; useBabelrc?: boolean; + tsConfigFile?: String; } diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index d4b07704b9..c0cc575436 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -1,12 +1,12 @@ import * as tsc from 'typescript'; -import { mockGlobalTSConfigSchema, getTSConfigOptionFromConfig, getTSConfig } from './utils'; +import { getTSConfig, getTSConfigOptionFromConfig, mockGlobalTSConfigSchema } from './utils'; export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { - + let transpiled = tsc.transpileModule(contents, { compilerOptions: getTSConfig(config || mockGlobalTSConfigSchema(global), true), - fileName: path + fileName: path, }); return transpiled.outputText; diff --git a/src/utils.ts b/src/utils.ts index 2f81232147..1ed18aa975 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -107,25 +107,28 @@ function readCompilerOptions(configPath: string) { } export function getTSConfigOptionFromConfig(globals: any) { - if (!globals) return 'tsconfig.json'; - + if (!globals) { return 'tsconfig.json'; } + const tsJestConfig = getTSJestConfig(globals); if (('__TS_CONFIG__' in globals) && globals.__TS_CONFIG__) { - console.warn('Using globals > __TS_CONFIG__ option for setting TS config is deprecated. Please set config using this option:\nglobals > ts-jest > tsConfig (object) or tsConfigFile (string). More information at https://github.com/kulshekhar/ts-jest#tsconfig'); + console.warn(`Using globals > __TS_CONFIG__ option for setting TS config is deprecated. + +Please set config using this option:\nglobals > ts-jest > tsConfig (object) or tsConfigFile +(string). More information at https://github.com/kulshekhar/ts-jest#tsconfig`); return globals.__TS_CONFIG__; } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; } - + return 'tsconfig.json'; } export function mockGlobalTSConfigSchema(globals: any) { const config = getTSConfigOptionFromConfig(globals); - return typeof config === 'string' ? + return (typeof config === 'string') ? { 'ts-jest': { tsConfigFile: config }} : - { __TS_CONFIG__: config }}; + { __TS_CONFIG__: config }; } export function getTSConfig(globals, collectCoverage: boolean = false) { From 567156a9d19dcc0cf8609e7888ec39c2039a28c9 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 10:49:42 +0430 Subject: [PATCH 250/256] Remove tsConfig direct config --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bff65db1f0..4f724a723f 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ custom configuration file (relative to the project's root directory) *__TS_CONFI For all available `tsc` options see [TypeScript docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html). -Note that if you haven't explicitly set the `module` property in the `tsConfig` setting (either directly or through a separate configuration file with `tsConfigFile`), it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. +Note that if you haven't explicitly set the `module` property through a separate configuration file with `tsConfigFile`, it will be overwritten to `commonjs` (regardless of the value in `tsconfig.json`) since that is the format Jest expects. This only happens during testing. ### Skipping Babel If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step. From 1224b4d11a5fd688d2a5d0647fd1faaceea5a8f4 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 11:23:21 +0430 Subject: [PATCH 251/256] Fix unnecessary if condition --- src/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 1ed18aa975..73f699f047 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -111,13 +111,12 @@ export function getTSConfigOptionFromConfig(globals: any) { const tsJestConfig = getTSJestConfig(globals); - if (('__TS_CONFIG__' in globals) && globals.__TS_CONFIG__) { + if (globals.__TS_CONFIG__) { console.warn(`Using globals > __TS_CONFIG__ option for setting TS config is deprecated. - Please set config using this option:\nglobals > ts-jest > tsConfig (object) or tsConfigFile (string). More information at https://github.com/kulshekhar/ts-jest#tsconfig`); return globals.__TS_CONFIG__; - } else if ('tsConfigFile' in tsJestConfig && tsJestConfig.tsConfigFile) { + } else if (tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; } From a3f3ae3ed5e2ffb7a8f7b8f7f12865ecfa6c5706 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 11:23:29 +0430 Subject: [PATCH 252/256] Remove unused import --- src/transpile-if-ts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transpile-if-ts.ts b/src/transpile-if-ts.ts index c0cc575436..682d900590 100644 --- a/src/transpile-if-ts.ts +++ b/src/transpile-if-ts.ts @@ -1,5 +1,5 @@ import * as tsc from 'typescript'; -import { getTSConfig, getTSConfigOptionFromConfig, mockGlobalTSConfigSchema } from './utils'; +import { getTSConfig, mockGlobalTSConfigSchema } from './utils'; export function transpileIfTypescript(path, contents, config?) { if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) { From 6c7c90dbcfc912a276b58b807dbd35b3077aa1a4 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 12:43:39 +0430 Subject: [PATCH 253/256] Remove tsConfig from warning --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 73f699f047..05641da805 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -112,9 +112,9 @@ export function getTSConfigOptionFromConfig(globals: any) { const tsJestConfig = getTSJestConfig(globals); if (globals.__TS_CONFIG__) { - console.warn(`Using globals > __TS_CONFIG__ option for setting TS config is deprecated. -Please set config using this option:\nglobals > ts-jest > tsConfig (object) or tsConfigFile -(string). More information at https://github.com/kulshekhar/ts-jest#tsconfig`); + console.warn(`Using globals > __TS_CONFIG__ option for setting TS config is deprecated. +Please set config using this option:\nglobals > ts-jest > tsConfigFile (string). +More information at https://github.com/kulshekhar/ts-jest#tsconfig`); return globals.__TS_CONFIG__; } else if (tsJestConfig.tsConfigFile) { return tsJestConfig.tsConfigFile; From 37c75a0fa39b439f7bd9a9ba59f811debeecefa2 Mon Sep 17 00:00:00 2001 From: Mohammad Rajabifard Date: Fri, 7 Jul 2017 12:44:44 +0430 Subject: [PATCH 254/256] Add test for deprecation warning --- tests/__tests__/tsconfig-default.spec.ts | 16 +- tests/deprecated-tsconfig/Hello.ts | 1 + .../__tests__/Hello.test.ts | 13 + tests/deprecated-tsconfig/package.json | 27 + tests/deprecated-tsconfig/tsconfig.json | 10 + tests/deprecated-tsconfig/yarn.lock | 1999 +++++++++++++++++ 6 files changed, 2061 insertions(+), 5 deletions(-) create mode 100644 tests/deprecated-tsconfig/Hello.ts create mode 100644 tests/deprecated-tsconfig/__tests__/Hello.test.ts create mode 100644 tests/deprecated-tsconfig/package.json create mode 100644 tests/deprecated-tsconfig/tsconfig.json create mode 100644 tests/deprecated-tsconfig/yarn.lock diff --git a/tests/__tests__/tsconfig-default.spec.ts b/tests/__tests__/tsconfig-default.spec.ts index b2fec46fb8..ae88613934 100644 --- a/tests/__tests__/tsconfig-default.spec.ts +++ b/tests/__tests__/tsconfig-default.spec.ts @@ -3,9 +3,9 @@ jest.mock('path'); import * as ts from 'typescript'; import {getTSConfig} from '../../src/utils'; +import runJest from '../__helpers__/runJest'; import * as path from 'path'; - describe('get default ts config', () => { beforeEach(() => { @@ -47,9 +47,15 @@ describe('get default ts config', () => { }); }); - describe('old behaviour (__TS_CONFIG__)', () => { + it('should show a warning when using deprecated option', () => { + const output = runJest('../deprecated-tsconfig', ['--no-cache']); + expect(output.stderr).toContain(`Using globals > __TS_CONFIG__ option for setting TS config is deprecated. +Please set config using this option:\nglobals > ts-jest > tsConfigFile (string). +More information at https://github.com/kulshekhar/ts-jest#tsconfig`); + }); + it('should be same results for null/undefined/etc.', () => { const result = getTSConfig(null); const resultUndefinedParam = getTSConfig(undefined); @@ -67,9 +73,9 @@ describe('get default ts config', () => { it('should not change the module if it is loaded from the Jest config global', () => { const config = getTSConfig({ - '__TS_CONFIG__': { - 'module': 'es2015' - } + __TS_CONFIG__: { + module: 'es2015', + }, }); expect(config.module).toBe(ts.ModuleKind.ES2015); diff --git a/tests/deprecated-tsconfig/Hello.ts b/tests/deprecated-tsconfig/Hello.ts new file mode 100644 index 0000000000..63464cf067 --- /dev/null +++ b/tests/deprecated-tsconfig/Hello.ts @@ -0,0 +1 @@ +export let num: number = 2; diff --git a/tests/deprecated-tsconfig/__tests__/Hello.test.ts b/tests/deprecated-tsconfig/__tests__/Hello.test.ts new file mode 100644 index 0000000000..8b4d6a2b91 --- /dev/null +++ b/tests/deprecated-tsconfig/__tests__/Hello.test.ts @@ -0,0 +1,13 @@ +declare var jest, describe, it, expect; + +import { num } from '../Hello'; + +describe('Hello Class', () => { + + it('should throw warning for deprecated __TS_CONFIG__', () => { + + expect(num).toBe(2); + + }); + +}); diff --git a/tests/deprecated-tsconfig/package.json b/tests/deprecated-tsconfig/package.json new file mode 100644 index 0000000000..19d73db29c --- /dev/null +++ b/tests/deprecated-tsconfig/package.json @@ -0,0 +1,27 @@ +{ + "jest": { + "globals": { + "__TS_CONFIG__": "tsconfig.json" + }, + "transform": { + ".(ts|tsx)": "../../preprocessor.js" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "coverageReporters": [ + "json" + ], + "collectCoverageFrom": [ + "Hello.ts", + "NullCoverage.js" + ], + "mapCoverage": true, + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ] + }, + "dependencies": { + "jest": "^20.0.4" + } +} diff --git a/tests/deprecated-tsconfig/tsconfig.json b/tests/deprecated-tsconfig/tsconfig.json new file mode 100644 index 0000000000..55f8667f97 --- /dev/null +++ b/tests/deprecated-tsconfig/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": false, + "jsx": "react", + "allowJs": true + } +} diff --git a/tests/deprecated-tsconfig/yarn.lock b/tests/deprecated-tsconfig/yarn.lock new file mode 100644 index 0000000000..d85ad3e22a --- /dev/null +++ b/tests/deprecated-tsconfig/yarn.lock @@ -0,0 +1,1999 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +abab@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" + +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + +acorn@^4.0.4: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-escapes@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0, ansi-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750" + dependencies: + color-convert "^1.0.0" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" + dependencies: + lodash "^4.14.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-core@^6.0.0, babel-core@^6.24.1: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.25.0.tgz#7dd42b0463c742e9d5296deb3ec67a9322dad729" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.25.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.25.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + +babel-generator@^6.18.0, babel-generator@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.25.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^20.0.3" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.0.0: + version "4.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.4.tgz#18dde84bf3ce329fddf3f4103fae921456d8e587" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.2" + test-exclude "^4.1.1" + +babel-plugin-jest-hoist@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" + +babel-preset-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" + dependencies: + babel-plugin-jest-hoist "^20.0.3" + +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" + dependencies: + babel-core "^6.24.1" + babel-runtime "^6.22.0" + core-js "^2.4.0" + home-or-tmp "^2.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" + +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" + lodash "^4.2.0" + +babel-traverse@^6.18.0, babel-traverse@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.25.0" + babylon "^6.17.2" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.18.0, babel-types@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.17.2, babylon@^6.17.4: + version "6.17.4" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-resolve@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.0, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +ci-info@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +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.1.0, convert-source-map@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug@^2.1.1, debug@^2.2.0, debug@^2.6.3: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.0.tgz#056695150d7aa93237ca7e378ac3b1682b7963b9" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +errno@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@^1.6.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" + dependencies: + merge "^1.1.3" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.0.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +handlebars@^4.0.3: + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +html-encoding-sniffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz#79bf7a785ea495fe66165e734153f363ff5437da" + dependencies: + whatwg-encoding "^1.0.1" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-ci@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-api@^1.1.1: + version "1.1.10" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.10.tgz#f27e5e7125c8de13f6a80661af78f512e5439b2b" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.0.7" + istanbul-lib-instrument "^1.7.3" + istanbul-lib-report "^1.1.1" + istanbul-lib-source-maps "^1.2.1" + istanbul-reports "^1.1.1" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-hook@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2, istanbul-lib-instrument@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.3.tgz#925b239163eabdd68cc4048f52c2fa4f899ecfa7" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.17.4" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" + dependencies: + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" + dependencies: + debug "^2.6.3" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" + dependencies: + handlebars "^4.0.3" + +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" + +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" + micromatch "^2.3.11" + node-notifier "^5.0.2" + pify "^2.3.0" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.2.12" + worker-farm "^1.3.1" + yargs "^7.0.2" + +jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" + dependencies: + chalk "^1.1.3" + glob "^7.1.1" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" + dependencies: + chalk "^1.1.3" + diff "^3.2.0" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" + +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" + +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + jsdom "^9.12.0" + +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^20.0.3" + micromatch "^2.3.11" + sane "~1.6.0" + worker-farm "^1.3.1" + +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" + once "^1.4.0" + p-map "^1.1.1" + +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" + dependencies: + chalk "^1.1.3" + pretty-format "^20.0.3" + +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" + dependencies: + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" + dependencies: + chalk "^1.1.3" + micromatch "^2.3.11" + slash "^1.0.0" + +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" + +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" + +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" + dependencies: + jest-regex-util "^20.0.3" + +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" + dependencies: + browser-resolve "^1.11.2" + is-builtin-module "^1.0.0" + resolve "^1.3.2" + +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" + dependencies: + babel-core "^6.0.0" + babel-jest "^20.0.3" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^7.0.2" + +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" + dependencies: + chalk "^1.1.3" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" + natural-compare "^1.4.0" + pretty-format "^20.0.3" + +jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" + leven "^2.1.0" + mkdirp "^0.5.1" + +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" + dependencies: + chalk "^1.1.3" + jest-matcher-utils "^20.0.3" + leven "^2.1.0" + pretty-format "^20.0.3" + +jest@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" + dependencies: + jest-cli "^20.0.4" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.7.0: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom@^9.12.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +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.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.14.0, lodash@^4.2.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^2.1.5, micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.0.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" + dependencies: + growly "^1.3.0" + semver "^5.3.0" + shellwords "^0.1.0" + which "^1.2.12" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.4.1" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.1.tgz#7ae9b07b0ea804db7e25f05cb5fe4097d4e4949f" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" + dependencies: + ansi-regex "^2.1.1" + ansi-styles "^3.0.0" + +private@^0.1.6: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +remove-trailing-separator@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@^2.79.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sax@^1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +shellwords@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +source-map-support@^0.4.2: + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" + dependencies: + source-map "^0.5.6" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +throat@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-fast-properties@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tough-cookie@^2.3.2, tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uuid@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + +whatwg-encoding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" + dependencies: + iconv-lite "0.4.13" + +whatwg-url@^4.3.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which@^1.2.12: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +worker-farm@^1.3.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.4.1.tgz#a438bc993a7a7d133bcb6547c95eca7cff4897d8" + dependencies: + errno "^0.1.4" + xtend "^4.0.1" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + +xtend@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From ce635063145593f6017fb8570a0b49747bd19787 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 7 Jul 2017 14:27:43 +0530 Subject: [PATCH 255/256] Add @morajabi to author list --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 032cdce4cd..3a601c89dc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,6 +25,7 @@ Kulshekhar Kabra Kyle Roach Marshall Bowers Maxim Samoilov +Mohammad Rajabifard OJ Kwon Tom Crockett Umidbek Karimov From 964ff562045b499ad77e25a4a089479e743b7e70 Mon Sep 17 00:00:00 2001 From: kulshekhar Date: Fri, 7 Jul 2017 14:28:01 +0530 Subject: [PATCH 256/256] Increment version to 20.0.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d55f7eb3d0..8e51a9c54b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "20.0.6", + "version": "20.0.7", "main": "index.js", "types": "./dist/index.d.ts", "description": "A preprocessor with sourcemap support to help use Typescript with Jest",