From 7e5a3a158b5e1e1469f81262eedc2ecffad3f7d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 19 Sep 2018 14:43:12 +0000 Subject: [PATCH 1/4] build(deps-dev): bump tslint-plugin-prettier from 1.3.0 to 2.0.0 Bumps [tslint-plugin-prettier](https://github.com/ikatyang/tslint-plugin-prettier) from 1.3.0 to 2.0.0. - [Release notes](https://github.com/ikatyang/tslint-plugin-prettier/releases) - [Changelog](https://github.com/ikatyang/tslint-plugin-prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/ikatyang/tslint-plugin-prettier/compare/v1.3.0...v2.0.0) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a0266d10f8..11118bc198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8348,9 +8348,9 @@ "dev": true }, "tslint-plugin-prettier": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tslint-plugin-prettier/-/tslint-plugin-prettier-1.3.0.tgz", - "integrity": "sha512-6UqeeV6EABp0RdQkW6eC1vwnAXcKMGJgPeJ5soXiKdSm2vv7c3dp+835CM8pjgx9l4uSa7tICm1Kli+SMsADDg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslint-plugin-prettier/-/tslint-plugin-prettier-2.0.0.tgz", + "integrity": "sha512-nA8yM+1tS9dylirSajTxxFV6jCQrIMQ0Ykl//jjRgqmwwmGp3hqodG+rtr16S/OUwyQBfoFScFDK7nuHYPd4Gw==", "dev": true, "requires": { "eslint-plugin-prettier": "^2.2.0", From 011b580cb4b11f9e3f9026ed1b91743a8fada32e Mon Sep 17 00:00:00 2001 From: Huafu Gandon Date: Wed, 19 Sep 2018 17:09:07 +0200 Subject: [PATCH 2/4] test(config): stop using snapshots for pkg versions --- src/config/config-set.spec.ts | 34 +++++++++++++++------------------- src/config/config-set.ts | 2 +- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/config/config-set.spec.ts b/src/config/config-set.spec.ts index 759c12dfa2..e08e16c73e 100644 --- a/src/config/config-set.spec.ts +++ b/src/config/config-set.spec.ts @@ -2,6 +2,7 @@ import { testing } from 'bs-logger' import { resolve } from 'path' import ts, { Diagnostic, ModuleKind, ScriptTarget } from 'typescript' +import { version as currentVersion } from '../../package.json' import * as fakers from '../__helpers__/fakers' import { mocked } from '../__helpers__/mocks' import { TsJestGlobalOptions } from '../types' @@ -20,6 +21,7 @@ backports.backportJestConfig.mockImplementation((_, config) => ({ })) const defaultResolve = (path: string) => `resolved:${path}` +const pkgVersion = (pkgName: string) => require(`${pkgName}/package.json`).version || '????' function createConfigSet({ jestConfig, @@ -314,29 +316,23 @@ describe('readTsConfig', () => { describe('versions', () => { describe('without babel', () => { it('should return correct version map', () => { - expect(createConfigSet().versions).toMatchInlineSnapshot(` -Object { - "jest": "23.6.0", - "ts-jest": "23.10.0-beta.6", - "tslib": "1.9.3", - "typescript": "3.0.3", -} -`) + expect(createConfigSet().versions).toEqual({ + jest: pkgVersion('jest'), + 'ts-jest': currentVersion, + typescript: pkgVersion('typescript'), + }) }) }) describe('with babel', () => { it('should return correct version map', () => { - expect(createConfigSet({ tsJestConfig: { babelConfig: {} } }).versions).toMatchInlineSnapshot(` -Object { - "@babel/core": "-", - "babel-core": "6.26.3", - "babel-jest": "23.6.0", - "jest": "23.6.0", - "ts-jest": "23.10.0-beta.6", - "tslib": "1.9.3", - "typescript": "3.0.3", -} -`) + expect(createConfigSet({ tsJestConfig: { babelConfig: {} } }).versions).toEqual({ + '@babel/core': '-', + 'babel-core': pkgVersion('babel-core'), + 'babel-jest': pkgVersion('babel-jest'), + jest: pkgVersion('jest'), + 'ts-jest': currentVersion, + typescript: pkgVersion('typescript'), + }) }) }) }) // versions diff --git a/src/config/config-set.ts b/src/config/config-set.ts index f8dfdd70db..c8774d8f23 100644 --- a/src/config/config-set.ts +++ b/src/config/config-set.ts @@ -234,7 +234,7 @@ export class ConfigSet { @Memoize() get versions(): Record { - const modules = ['jest', this.tsJest.compiler, 'tslib'] + const modules = ['jest', this.tsJest.compiler] if (this.tsJest.babelConfig) { modules.push('@babel/core', 'babel-core', 'babel-jest') } From a18e919a5785889d53fcc8cb4139c7fc986f5ef3 Mon Sep 17 00:00:00 2001 From: Huafu Gandon Date: Wed, 19 Sep 2018 17:22:22 +0200 Subject: [PATCH 3/4] style(fix): exclude package.json from tslint rules --- tslint.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tslint.json b/tslint.json index a32496553b..7669513b00 100644 --- a/tslint.json +++ b/tslint.json @@ -6,6 +6,7 @@ ], "linterOptions": { "exclude": [ + "package.json", "dist/**/*", "**/node_modules/**/*", "e2e/__cases__/**/*" From 70775f1d0e6dd221cf205723376286c170b32d2b Mon Sep 17 00:00:00 2001 From: Huafu Gandon Date: Wed, 19 Sep 2018 17:23:17 +0200 Subject: [PATCH 4/4] ci(lint): run lint scripts in series instead of parallel --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e73edeb31b..3031974482 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,13 @@ "build": "tsc -p tsconfig.build.json", "build:watch": "tsc -p tsconfig.build.json -w", "clean": "node scripts/clean.js", - "pretest": "run-p typecheck lint", + "pretest": "run-s typecheck lint", "test": "run-s -s test:e2e \"test:unit -- {@}\" --", "test:prepare": "npm run test:e2e -- --prepareOnly", "test:e2e": "node scripts/e2e.js", "test:unit": "jest", "test:external": "node scripts/test-external-project.js", - "lint": "run-p lint:ts lint:js", + "lint": "run-s lint:ts lint:js", "lint:js": "eslint . -f stylish", "lint:ts": "tslint -t stylish --project .", "lint:fix": "run-s lint:fix:ts lint:fix:js",