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