it
の代わりに fit
もしくは describe
の代わりに fdescribe
を使うと、そのテストだけを実行してくれる
使い方
describe('Something', () => {
beforeEach(() => {
// ... preparation
});
it('should ...', async(() => {
// ... test 1 logic here
}));
// ... more tests and/or nested `describe()` calls
});
の it
を fit
に変えるだけ。
describe('Something', () => {
beforeEach(() => {
// ... preparation
});
fit('should ...', async(() => {
// ... test 1 logic here
}));
// ... more tests and/or nested `describe()` calls
});
例えば 31 個あるテストのうち一つを fit
にすると、、、
Chrome 63.0.3239 (Mac OS X 10.11.6): Executed 31 of 31 SUCCESS (16.162 secs / 16.127 secs)
これが
こうなる↓
Chrome 63.0.3239 (Mac OS X 10.11.6): Executed 1 of 31 (skipped 30) SUCCESS (0.13 secs / 0.087 secs)
これは Angular のテストを作っていく上では必須の知識なので要チェック!