Schematics testing infrastructure: ability to easily bootstrap a Tree
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 14時間 23分
- マージ済み PR(30日)
- 162
説明
### Bug Report or Feature Request (mark with an `x`)
```
- [ ] bug report -> please search issues before submitting
- [x] feature request
```
### Desired functionality
I'd like to be able to more easily unit test individual Rules. and to do this, I'd like to be able to easily create a Tree on the fly.
My current strategy is to create a new schematic for the sole purpose of testing. But there is quite a bit of boilerplate that goes into this: the schematic code, the schema, the build rules, the awkward dependency of the test on this schematic, and the construction of a new schematicRunner in the test. Furthermore, different Rules need different Tree "boilerplate" for testing, so instead of creating a new schematic for each, I've just been jamming all the different types of files I need into this one test-only schematic, which is becoming unwieldy - which files are for testing which Rules?
Sometimes, I am testing a really simple Rule that only operates on one file, and I just want to be able to ask some function: "give me a tree with one file at this certain path with this certain content" or "give me a tree with an empty file at this path" and so on.
I think it'd be great if there was some testing infrastructure that could cook up a quick Tree in place. Or - does something like this already exist?
コントリビューションガイド
調査の方向性
まず、既存のテスト専用の Schematic セットアップを読みます。これには、その Schematic コード、スキーマ、ビルドルール、およびテストでの SchematicRunner の構築が含まれます。個々の Rules が使用する異なる Tree のボイラープレートを比較し、要求されたファイルと内容を作成できる小さなテストエントリーポイントを定義します。完了の条件は、専用の Schematic なしで Rules の単体テストを実行できることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- testing, tooling
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100