Skip to content

Commit

Permalink
improvement(jest): config
Browse files Browse the repository at this point in the history
  • Loading branch information
seognil committed Jan 22, 2020
1 parent a95f296 commit 64e83c7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 125 deletions.
16 changes: 4 additions & 12 deletions testing/jest/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
module.exports = {
plugins: [
'@babel/plugin-syntax-dynamic-import',

['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
// * ---------------- simply support esnext and ts

// ['@babel/plugin-transform-runtime', { corejs: 3 }],
],
module.exports = {
presets: [
['@babel/preset-env', { modules: 'commonjs' }],
'@babel/preset-react',
//
'@babel/preset-env',
'@babel/preset-typescript',
],
};
2 changes: 2 additions & 0 deletions testing/jest/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// * ---------------- super simple config demo

module.exports = {
verbose: true,
collectCoverage: true,
Expand Down
8 changes: 1 addition & 7 deletions testing/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
"test:watch": "jest -w"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@types/jest": "^24.9.0",
"@types/node": "^13.1.8",
"jest": "^24.9.0"
}
}
2 changes: 1 addition & 1 deletion testing/jest/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ npm run test:watch

Check [Jest Doc](https://jestjs.io/docs/en/expect)

Try change test code in `*test.js` files
Try to modify test files in `test` folder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { add } from './add';
import { add } from '../add';

test('test add function', () => {
expect(add(1, 2)).toBe(3);
Expand Down
File renamed without changes.
9 changes: 1 addition & 8 deletions testing/jest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
{
"compilerOptions": {
"types": [
"jest",
"node"
]
}
}
{}
105 changes: 9 additions & 96 deletions testing/jest/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
"@babel/helper-explode-assignable-expression" "^7.8.3"
"@babel/types" "^7.8.3"

"@babel/helper-builder-react-jsx@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/helper-builder-react-jsx/download/@babel/helper-builder-react-jsx-7.8.3.tgz#dee98d7d79cc1f003d80b76fe01c7f8945665ff6"
integrity sha1-3umNfXnMHwA9gLdv4Bx/iUVmX/Y=
dependencies:
"@babel/types" "^7.8.3"
esutils "^2.0.0"

"@babel/helper-call-delegate@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/helper-call-delegate/download/@babel/helper-call-delegate-7.8.3.tgz#de82619898aa605d409c42be6ffb8d7204579692"
Expand Down Expand Up @@ -275,23 +267,6 @@
"@babel/helper-remap-async-to-generator" "^7.8.3"
"@babel/plugin-syntax-async-generators" "^7.8.0"

"@babel/plugin-proposal-class-properties@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-class-properties/download/@babel/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e"
integrity sha1-XgZlSvXNBLYIkVqtqbKmeIAERk4=
dependencies:
"@babel/helper-create-class-features-plugin" "^7.8.3"
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-proposal-decorators@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-decorators/download/@babel/plugin-proposal-decorators-7.8.3.tgz#2156860ab65c5abf068c3f67042184041066543e"
integrity sha1-IVaGCrZcWr8GjD9nBCGEBBBmVD4=
dependencies:
"@babel/helper-create-class-features-plugin" "^7.8.3"
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-decorators" "^7.8.3"

"@babel/plugin-proposal-dynamic-import@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-dynamic-import/download/@babel/plugin-proposal-dynamic-import-7.8.3.tgz#38c4fe555744826e97e2ae930b0fb4cc07e66054"
Expand Down Expand Up @@ -355,14 +330,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-decorators@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-syntax-decorators/download/@babel/plugin-syntax-decorators-7.8.3.tgz#8d2c15a9f1af624b0025f961682a9d53d3001bda"
integrity sha1-jSwVqfGvYksAJflhaCqdU9MAG9o=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3":
"@babel/plugin-syntax-dynamic-import@^7.8.0":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-syntax-dynamic-import/download/@babel/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"
integrity sha1-Yr+Ysto80h1iYVT8lu5bPLaOrLM=
Expand All @@ -376,13 +344,6 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-jsx@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-syntax-jsx/download/@babel/plugin-syntax-jsx-7.8.3.tgz#521b06c83c40480f1e58b4fd33b92eceb1d6ea94"
integrity sha1-UhsGyDxASA8eWLT9M7kuzrHW6pQ=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-syntax-nullish-coalescing-operator/download/@babel/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
Expand Down Expand Up @@ -611,38 +572,6 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-transform-react-display-name@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-react-display-name/download/@babel/plugin-transform-react-display-name-7.8.3.tgz#70ded987c91609f78353dd76d2fb2a0bb991e8e5"
integrity sha1-cN7Zh8kWCfeDU9120vsqC7mR6OU=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-transform-react-jsx-self@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-react-jsx-self/download/@babel/plugin-transform-react-jsx-self-7.8.3.tgz#c4f178b2aa588ecfa8d077ea80d4194ee77ed702"
integrity sha1-xPF4sqpYjs+o0HfqgNQZTud+1wI=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-jsx" "^7.8.3"

"@babel/plugin-transform-react-jsx-source@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-react-jsx-source/download/@babel/plugin-transform-react-jsx-source-7.8.3.tgz#951e75a8af47f9f120db731be095d2b2c34920e0"
integrity sha1-lR51qK9H+fEg23Mb4JXSssNJIOA=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-jsx" "^7.8.3"

"@babel/plugin-transform-react-jsx@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-react-jsx/download/@babel/plugin-transform-react-jsx-7.8.3.tgz#4220349c0390fdefa505365f68c103562ab2fc4a"
integrity sha1-QiA0nAOQ/e+lBTZfaMEDViqy/Eo=
dependencies:
"@babel/helper-builder-react-jsx" "^7.8.3"
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-syntax-jsx" "^7.8.3"

"@babel/plugin-transform-regenerator@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-regenerator/download/@babel/plugin-transform-regenerator-7.8.3.tgz#b31031e8059c07495bf23614c97f3d9698bc6ec8"
Expand All @@ -657,16 +586,6 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-transform-runtime@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-runtime/download/@babel/plugin-transform-runtime-7.8.3.tgz#c0153bc0a5375ebc1f1591cb7eea223adea9f169"
integrity sha1-wBU7wKU3XrwfFZHLfuoiOt6p8Wk=
dependencies:
"@babel/helper-module-imports" "^7.8.3"
"@babel/helper-plugin-utils" "^7.8.3"
resolve "^1.8.1"
semver "^5.5.1"

"@babel/plugin-transform-shorthand-properties@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-shorthand-properties/download/@babel/plugin-transform-shorthand-properties-7.8.3.tgz#28545216e023a832d4d3a1185ed492bcfeac08c8"
Expand Down Expand Up @@ -784,17 +703,6 @@
levenary "^1.1.0"
semver "^5.5.0"

"@babel/preset-react@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/preset-react/download/@babel/preset-react-7.8.3.tgz?cache=0&sync_timestamp=1578966819906&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fpreset-react%2Fdownload%2F%40babel%2Fpreset-react-7.8.3.tgz#23dc63f1b5b0751283e04252e78cf1d6589273d2"
integrity sha1-I9xj8bWwdRKD4EJS54zx1liSc9I=
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"
"@babel/plugin-transform-react-display-name" "^7.8.3"
"@babel/plugin-transform-react-jsx" "^7.8.3"
"@babel/plugin-transform-react-jsx-self" "^7.8.3"
"@babel/plugin-transform-react-jsx-source" "^7.8.3"

"@babel/preset-typescript@^7.8.3":
version "7.8.3"
resolved "https://registry.npm.taobao.org/@babel/preset-typescript/download/@babel/preset-typescript-7.8.3.tgz#90af8690121beecd9a75d0cc26c6be39d1595d13"
Expand Down Expand Up @@ -1052,6 +960,11 @@
dependencies:
jest-diff "^24.3.0"

"@types/node@^13.1.8":
version "13.1.8"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-13.1.8.tgz#1d590429fe8187a02707720ecf38a6fe46ce294b"
integrity sha1-HVkEKf6Bh6AnB3IOzzim/kbOKUs=

"@types/stack-utils@^1.0.1":
version "1.0.1"
resolved "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
Expand Down Expand Up @@ -1689,7 +1602,7 @@ estraverse@^4.2.0:
resolved "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=

esutils@^2.0.0, esutils@^2.0.2:
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.npm.taobao.org/esutils/download/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=
Expand Down Expand Up @@ -3418,7 +3331,7 @@ [email protected]:
resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.1.7.tgz?cache=0&sync_timestamp=1578362210740&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=

resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1:
resolve@^1.10.0, resolve@^1.3.2:
version "1.14.2"
resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.14.2.tgz?cache=0&sync_timestamp=1578362210740&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2"
integrity sha1-2/MdD6mLHymqUWl4O5wpDLhl/qI=
Expand Down Expand Up @@ -3484,7 +3397,7 @@ sax@^1.2.4:
resolved "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha1-KBYjTiN4vdxOU1T6tcqold9xANk=

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=
Expand Down

0 comments on commit 64e83c7

Please sign in to comment.