$ npm install --save-dev parcel-bundler
$ npm install --save react react-dom @types/react @types/react-dom
$ npm install --save-dev jest @types/jest ts-jest
// jest.config.js
module.exports = {
"roots": [
"<rootDir>/src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
}
// tsconfig.json
{
"compilerOptions": {
"jsx": "react"
}
}
$ npm install --save-dev react-testing-library
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Node",
"program": "${workspaceFolder}/node_modules/.bin/parcel",
"args": [
"./src/index.html"
]
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:1234",
"webRoot": "${workspaceFolder}",
"breakOnLoad": true,
"sourceMapPathOverrides":{
"../*": "${webRoot}/*",
}
}
],
"compounds": [
{
"name": "Debug App",
"configurations": [
"Launch Node",
"Launch Chrome",
]
}
]
}