|
1 | | -# -typescript-jest |
| 1 | +# TDDBC for TypeScript + Jest with Node.js |
| 2 | + |
| 3 | +これは、TDDBC の TypeScript + Jest 向けプロジェクトです。 |
| 4 | + |
| 5 | +## Documentation |
| 6 | + |
| 7 | +### セットアップ&テスト |
| 8 | + |
| 9 | +```sh |
| 10 | +$ git clone https://github.com/tddbc/typescript-jest.git |
| 11 | +$ cd typescript-jest |
| 12 | +$ npm install |
| 13 | +$ npm test |
| 14 | + |
| 15 | + |
| 16 | +> npm run fmt:check && npm run lint |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +> prettier --check *.ts lib/*.ts |
| 21 | + |
| 22 | +Checking formatting... |
| 23 | +All matched files use Prettier code style! |
| 24 | + |
| 25 | + |
| 26 | +> eslint main.ts lib/*.ts |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +> ts-node node_modules/jest/bin/jest.js |
| 31 | + |
| 32 | + PASS lib/sample_test.ts |
| 33 | + ✓ exported class (1 ms) |
| 34 | + ✓ private function (1 ms) |
| 35 | + |
| 36 | +Test Suites: 1 passed, 1 total |
| 37 | +Tests: 2 passed, 2 total |
| 38 | +Snapshots: 0 total |
| 39 | +Time: 0.978 s, estimated 2 s |
| 40 | +Ran all test suites. |
| 41 | +``` |
| 42 | + |
| 43 | +### コマンド |
| 44 | + |
| 45 | +| コマンド | 内容 | |
| 46 | +| :------------------ | :------------------------------------------------------------- | |
| 47 | +| `npm start` | main.ts を実行します | |
| 48 | +| `npm run fmt` | コードの整形を行います | |
| 49 | +| `npm run fmt:check` | コードの整形ルールに違反しているファイルがないかチェックします | |
| 50 | +| `npm run lint` | コードの静的検証を行います | |
| 51 | +| `npm run pretest` | fmt:check と lint を行います | |
| 52 | +| `npm test` | pretest とテストをまとめて行います | |
| 53 | +| `npm run watch` | ファイル変更を監視し、変更があったらテストを自動で行います | |
| 54 | + |
| 55 | +## License |
| 56 | + |
| 57 | +Copyright (c) 2022 TDD BaseCamp and other contributors |
| 58 | + |
| 59 | +http://devtesting.jp/tddbc/ |
| 60 | + |
| 61 | +https://github.com/tddbc |
| 62 | + |
| 63 | +Licensed under the MIT license. |
0 commit comments