mirror of
https://github.com/kou029w/jest-hands-on.git
synced 2025-02-01 22:28:37 +00:00
Compare commits
3 commits
cef8925773
...
f64d567447
Author | SHA1 | Date | |
---|---|---|---|
f64d567447 | |||
4cbd8fe512 | |||
36f9c824cd |
10 changed files with 896 additions and 971 deletions
|
@ -13,9 +13,9 @@
|
||||||
"format": "prettier --ignore-path .gitignore --write ."
|
"format": "prettier --ignore-path .gitignore --write ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0",
|
"jest": "^29.4.3",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.4",
|
||||||
"prettier-plugin-md-nocjsp": "^1.3.0"
|
"prettier-plugin-md-nocjsp": "^1.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
Jest公式サイト: [https://jestjs.io/ja](https://jestjs.io/ja)
|
Jest公式サイト: [https://jestjs.io/ja](https://jestjs.io/ja)
|
||||||
|
|
||||||
Jestは、JavaScriptのテストを行うためのフレームワークです。
|
Jestは、JavaScriptのテストを行うためのフレームワークです。
|
||||||
Facebook (現 Meta) によってメンテナンスを続けられており、2022年現在でもJavaScriptを使用する多くの開発者が使用している人気のツールです。
|
2022年現在、JavaScriptを使用する多くの開発者が使用している人気のツールです。
|
||||||
|
|
||||||
> ![2021.stateofjs.com ランキング](https://i.gyazo.com/c2b2c4a6111af6aa960f71bbadd4b5ef.png)
|
> ![ランキング](assets/2022_stateofjs_libraries_testing_ranking.png)
|
||||||
>
|
>
|
||||||
> ―― 画像の出典: [2021.stateofjs.com](https://2021.stateofjs.com/ja-JP/libraries/testing/)
|
> ―― 画像の出典: [2022.stateofjs.com](https://2022.stateofjs.com/ja-JP/libraries/testing/)
|
||||||
|
|
||||||
少ない設定で簡単にテストをはじめることができます。
|
|
||||||
|
|
BIN
src/assets/2022_stateofjs_libraries_testing_ranking.png
Normal file
BIN
src/assets/2022_stateofjs_libraries_testing_ranking.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 526 KiB |
|
@ -12,7 +12,7 @@ Node.js標準でESMを取り扱えるようにするためには `package.json`
|
||||||
|
|
||||||
このように書き加えると、プロジェクトの `.js` ファイルはESMとして取り扱われます。
|
このように書き加えると、プロジェクトの `.js` ファイルはESMとして取り扱われます。
|
||||||
|
|
||||||
一方、Jestに関しては、2022年7月現在、Node.js標準のESMをサポートしていません。
|
一方、Jestに関しては、2023年3月現在、Node.js標準のESMをサポートしていません。
|
||||||
そのため、JestでESMをテストするには、さらにJavaScriptのコードを変換するための設定を行う必要があります。
|
そのため、JestでESMをテストするには、さらにJavaScriptのコードを変換するための設定を行う必要があります。
|
||||||
|
|
||||||
ESMのJavaScriptのコードを変換するには、たとえば、下記の方法があります。
|
ESMのJavaScriptのコードを変換するには、たとえば、下記の方法があります。
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0"
|
"jest": "^29.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0"
|
"jest": "^29.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0"
|
"jest": "^29.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0"
|
"jest": "^29.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"watch": "jest --watchAll"
|
"watch": "jest --watchAll"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.9",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"jest": "^29.0.0"
|
"jest": "^29.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue