Skip to content

Commit

Permalink
Make sure Electron app gets closed after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Sep 18, 2022
1 parent 89a414c commit 98c2bc5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/explorer/explore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export save

global app = nothing

function close_explore_app()
if !isnothing(app)
close(app)
global app = nothing
end
end

#include functions and modules
include("getdataparts.jl")
include("buildspecs.jl")
Expand Down
2 changes: 2 additions & 0 deletions test/test_explorer_compositecomp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@
p_type = _is_VegaLite_v3() ? VegaLite.VLSpec : VegaLite.VLSpec{:plot}
@test typeof(Mimi.plot(m, :top, item)) == p_type
end

Mimi.close_explore_app()
end
2 changes: 2 additions & 0 deletions test/test_explorer_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,6 @@
end
@test static_spec["name"] == interactive_spec["name"] == name
end

Mimi.close_explore_app()
end
2 changes: 2 additions & 0 deletions test/test_explorer_sim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@
plot_type_test(p)
p = Mimi.plot(si_disk, :grosseconomy, :depk_var; interactive = true, results_output_dir = results_output_dir);
plot_type_test(p)

Mimi.close_explore_app()
end

0 comments on commit 98c2bc5

Please sign in to comment.