Skip to content

Commit 9148611

Browse files
committed
close electron at end of testing
1 parent 1cad0aa commit 9148611

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

NetworkDynamicsInspector/test/multiselect_test.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function electron(app)
1111
end
1212
disp = Bonito.use_electron_display(devtools = true)
1313
display(disp, app)
14+
disp
1415
end
1516

1617
@testset "Test TomSelect" begin
@@ -26,7 +27,7 @@ end
2627
selection = Observable{Vector{Symbol}}(Symbol[:Rust, :French]),
2728
selection_single = Observable{Vector{Symbol}}(Symbol[:Julia])
2829
)
29-
app = App(;) do session
30+
disp = App(;) do session
3031
NetworkDynamicsInspector.clear_obs!(gui)
3132

3233
ms1 = TomSelect(gui.options, gui.selection; placeholder="multi", T=Symbol)
@@ -65,5 +66,5 @@ end
6566
]
6667
@test gui.selection[] == [:French]
6768
@test gui.selection_single[] == [:French]
68-
close.(Electron.applications())
69+
close(disp)
6970
end

NetworkDynamicsInspector/test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,10 @@ end
133133
@safetestset "Multiselect Tests" begin include("multiselect_test.jl") end
134134
@safetestset "Slider Tests" begin include("slider_test.jl") end
135135
end
136+
137+
# close all open electron windows
138+
try
139+
close.(Electron.applications())
140+
catch
141+
end
136142
end

NetworkDynamicsInspector/test/slider_test.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function electron(app)
1010
end
1111
disp = Bonito.use_electron_display(devtools = true)
1212
display(disp, app)
13+
disp
1314
end
1415

1516
@testset "Test Slider" begin
@@ -20,7 +21,7 @@ end
2021
val = Observable{Float64}(0.0)
2122
)
2223

23-
App(;) do session
24+
disp = App(;) do session
2425
NetworkDynamicsInspector.clear_obs!(gui)
2526
sl1 = ContinuousSlider(gui.range, gui.val1, gui.val2)
2627
sl2 = ContinuousSlider(gui.range, gui.val; arrowkeys=true)
@@ -39,4 +40,5 @@ end
3940

4041
gui.range[] = (-0.5, 0.5)
4142
gui.range[] = (-1, 1)
43+
close(disp)
4244
end

0 commit comments

Comments
 (0)