Skip to content

Commit 0d18b6a

Browse files
committed
Restore the backtrace tests
1 parent 14c5051 commit 0d18b6a

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

tests/spec/features/backtrace_spec.rb

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
11
require 'spec_helper'
22
require 'support/editor'
3+
require 'support/playground_actions'
34

45
RSpec.feature "A backtrace is shown for certain errors", type: :feature, js: true do
5-
before { pending "Backtracing has a large performance penalty" }
6+
include PlaygroundActions
67

78
before do
89
visit '/'
910
editor.set(code)
10-
within('.header') { click_on("Run") }
1111
end
1212

13-
scenario "a stack trace is shown" do
14-
within('.output-stderr') do
15-
expect(page).to have_content 'stack backtrace:'
16-
expect(page).to have_content 'rust_begin_unwind'
13+
context "backtraces are enabled" do
14+
before do
15+
in_advanced_options_menu { choose 'enabled' }
16+
within('.header') { click_on("Run") }
17+
end
18+
19+
scenario "a backtrace is shown" do
20+
within('.output-stderr') do
21+
expect(page).to have_content 'stack backtrace:'
22+
expect(page).to have_content 'rust_begin_unwind'
23+
end
24+
end
25+
26+
scenario "filenames link to that line of code" do
27+
within('.output-stderr') do
28+
expect(page).to have_link('main.rs:2')
29+
expect(page).to have_link('main.rs:6')
30+
end
1731
end
1832
end
1933

20-
scenario "filenames link to that line of code" do
21-
within('.output-stderr') do
22-
expect(page).to have_link('main.rs:2')
23-
expect(page).to have_link('main.rs:6')
34+
context "backtraces are disabled" do
35+
before do
36+
within('.header') { click_on("Run") }
37+
end
38+
39+
scenario "the backtrace suggestion is a link" do
40+
within('.output-stderr') do
41+
expect(page).to have_link(text: /Run with .* a backtrace/)
42+
end
2443
end
2544
end
2645

0 commit comments

Comments
 (0)