mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:12:45 +08:00
DEV: Remove direct minitest dependency to appease ruby-lsp (#26056)
Having minitest as a direct dependency causes ruby-lsp to use it as our test runner (per https://github.com/Shopify/ruby-lsp/blob/d1da8858a1/lib/ruby_lsp/requests/support/dependency_detector.rb#L40-L55). This makes VSCode's test explorer incorrectly display Minitest 'run' buttons above all our tests. We were only using it in `emoji.rake`... and that wasn't even working with the latest version of Minitest. This commit refactors `emoji.rake` to work without minitest, and removes the dependency.
This commit is contained in:
parent
65c6909419
commit
dfc6bb4029
1
Gemfile
1
Gemfile
|
@ -125,7 +125,6 @@ group :test do
|
|||
gem "capybara", require: false
|
||||
gem "webmock", require: false
|
||||
gem "fakeweb", require: false
|
||||
gem "minitest", require: false
|
||||
gem "simplecov", require: false
|
||||
gem "selenium-webdriver", "~> 4.14", require: false
|
||||
gem "selenium-devtools", require: false
|
||||
|
|
|
@ -602,7 +602,6 @@ DEPENDENCIES
|
|||
mini_sql
|
||||
mini_suffix
|
||||
minio_runner
|
||||
minitest
|
||||
mocha
|
||||
multi_json
|
||||
mustache
|
||||
|
|
|
@ -475,12 +475,27 @@ def confirm_overwrite(path)
|
|||
STDIN.gets.chomp
|
||||
end
|
||||
|
||||
class TestEmojiUpdate < Minitest::Test
|
||||
class TestEmojiUpdate
|
||||
def self.run_and_summarize
|
||||
puts "Runnings tests..."
|
||||
reporter = Minitest::SummaryReporter.new
|
||||
TestEmojiUpdate.run(reporter)
|
||||
puts reporter
|
||||
puts "Running tests..."
|
||||
instance = TestEmojiUpdate.new
|
||||
instance.public_methods.each do |method|
|
||||
next unless method.to_s.start_with? "test_"
|
||||
print "Running #{method}..."
|
||||
instance.public_send(method)
|
||||
puts " ✅"
|
||||
rescue StandardError => e
|
||||
puts " ❌"
|
||||
puts e.message.indent(2)
|
||||
end
|
||||
end
|
||||
|
||||
def assert_equal(a, b)
|
||||
raise "Expected #{a.inspect} to equal #{b.inspect}" if a != b
|
||||
end
|
||||
|
||||
def assert(a)
|
||||
raise "Expected #{a.inspect} to be truthy" if !a
|
||||
end
|
||||
|
||||
def image_path(style, name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user