Adding any tests to app.component.spec.ts (even empty ones) causes other tests to fail
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, typescript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với app.component.spec.ts và hai spec được liên kết trong src/components/clickerForm/clickerForm.spec.ts và src/components/clickerButton/clickerButton.spec.ts. Clone repository, chạy npm install, bỏ chú thích các test trong app.component.spec.ts và chạy npm test để tái hiện tương tác. Hoàn thành nghĩa là giải thích lý do các test ảnh hưởng lẫn nhau và khôi phục việc thực thi test độc lập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
After migrating from @angular/cli to this testing setup, two of my tests started failing. Both of these tests are long standing and have not been modified in ages.
I tried re-writing one of the tests using the latest recommendations on Stack Overflow, to no avail.
To cut a very long story short, I figured out that commenting out the tests in app.component.spec.ts let the tests run fine.
I also tried empty tests (nothing in the test block at all), as well as adding an afterEach() => destroy, which didn't help.
To Replicate:
git clone git@github.com:lathonez/clicker.gitcd clickernpm install- uncomment the tests in
app.component.spec.ts npm test
Note
I do not expect a solution to this problem, but I consider leaving the repo in it's current state (as long as we are unable to explain the behaviour) pretty dangerous in terms of other user's time. There is nothing at all to make you think that these tests would be affected by app.component.spec.ts, indeed everything we know about the unit testing setup tells us otherwise. You can easily sink several hours into this problem before coming to this point, or just getting frustrated and binning your perfectly valid tests.
- Ngôn ngữ chính
- TypeScript
- Star
- 370
- Fork
- 144
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/ionic-unit-testing-example
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
-
Error output is minified Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
ionic-team/ionic-unit-testing-example#91 · 7 bình luận · 11 reaction ·
Tất cả issue của ionic-team/ionic-unit-testing-example
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100