2023-08-25 17:44:30 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe "assets:precompile" do
|
|
|
|
before do
|
|
|
|
Rake::Task.clear
|
|
|
|
Discourse::Application.load_tasks
|
|
|
|
end
|
|
|
|
|
2023-10-02 18:36:06 +08:00
|
|
|
describe "assets:precompile:theme_transpiler" do
|
2023-08-25 17:44:30 +08:00
|
|
|
it "compiles the js processor" do
|
2023-10-02 18:36:06 +08:00
|
|
|
out = capture_stdout { Rake::Task["assets:precompile:theme_transpiler"].invoke }
|
2023-08-25 17:44:30 +08:00
|
|
|
|
2023-10-02 18:36:06 +08:00
|
|
|
expect(out).to match(%r{Compiled theme-transpiler: tmp/theme-transpiler})
|
2023-08-25 17:44:30 +08:00
|
|
|
path = out.match(/: (.+)/)[1]
|
|
|
|
expect(File.exist?(path)).to eq(true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|