Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test Commander code in my app #53

Open
GBH opened this issue Aug 29, 2017 · 4 comments
Open

How to test Commander code in my app #53

GBH opened this issue Aug 29, 2017 · 4 comments
Assignees
Milestone

Comments

@GBH
Copy link

GBH commented Aug 29, 2017

Realised that I left that code untested and #52 crashed everything in production.

Assuming I have simple commander like this:

defmodule FooCommander do
  use Drab.Commander

  def pres_buton(socket, _sender) do
    Drab.Live.poke(socket, some_variable: "new value")
  end
end

How can I test this code? Mainly to ensure nothing is crashing there.

Thanks!

@grych
Copy link
Owner

grych commented Aug 29, 2017

I am using Hound + Chromerdriver. See tests in the drab repository.

Test helpers are in my mind, but not in the near future.

@GBH
Copy link
Author

GBH commented Aug 29, 2017

I'm looking for something close to https://hexdocs.pm/phoenix/Phoenix.ChannelTest.html

Full-on integration testing is a bit too much, I think.

@grych
Copy link
Owner

grych commented Aug 29, 2017

This is what I meant with "test helpers". It must be done before going stable, but - sorry - not in the nearest future.

Drab tests are mostly integration, as it must cover the whole stuff (server + client)

@grych grych removed the help wanted label May 9, 2018
@grych grych self-assigned this May 9, 2018
@grych
Copy link
Owner

grych commented May 9, 2018

Finally, for 1.0, it will be done with the helpers on integration tests, based on hound + chromedriver.

@grych grych added this to the 1.0.0 milestone May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants