Skip to content

Commit f9d5050

Browse files
committed
update(docs): Missing test execution times in Minitest
1 parent a30ff3b commit f9d5050

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docusaurus/docs/ruby/troubleshooting.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,27 @@ Please consider:
516516

517517
- [Splitting by test examples](split-by-test-examples.mdx) if you have a bottleneck file that is packed with test examples
518518
- If it's a retry, remember that [`KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true`](reference.md#knapsack_pro_fixed_queue_split-queue-mode) uses a cached split
519+
520+
## Missing test execution times in Minitest
521+
522+
Test execution times are not measured if you use the `minitest-spec-rails` gem with the not-recommended test style:
523+
524+
```ruby
525+
require 'test_helper'
526+
describe User do
527+
# THIS IS NOT RECOMMENDED!
528+
end
529+
```
530+
531+
Please use [the recommended style as suggested in the minitest-spec-rails documentation](https://github.com/metaskills/minitest-spec-rails?tab=readme-ov-file#test-styles).
532+
Only then Knapsack Pro can measure test execution times.
533+
534+
```ruby
535+
require 'test_helper'
536+
class UserTest < ActiveSupport::TestCase
537+
let(:user_ken) { User.create! :email => '[email protected]' }
538+
it 'works' do
539+
expect(user_ken).must_be_instance_of User
540+
end
541+
end
542+
```

0 commit comments

Comments
 (0)