Coder Social home page Coder Social logo

Testing Guide about phoenix_guides HOT 12 CLOSED

lancehalvorsen avatar lancehalvorsen commented on May 20, 2024
Testing Guide

from phoenix_guides.

Comments (12)

chrismccord avatar chrismccord commented on May 20, 2024

This would be really nice. Right now the best we have is telling folks to look at the tests in the Phoenix suite. Maybe we can extract some of that into a general testing guide? Phoenix will eventually provide a Phoenix.Test helper module for easier testing, but we have some other things to tackle first.

from phoenix_guides.

jeregrine avatar jeregrine commented on May 20, 2024

Since @josevalim did such a nice job with ConnTest we should be able to tackle this one.

from phoenix_guides.

josevalim avatar josevalim commented on May 20, 2024

Thank you! Channel test should come this weekend. We also have ModelCase on
v0.12.0z

José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Lead Developer

from phoenix_guides.

lancehalvorsen avatar lancehalvorsen commented on May 20, 2024

👍 to the delights of ConnTest and ModelCase!

Also, since the generators now provide test files, getting folks up to speed on testing models and controllers will be significantly easier, I think.

Looking forward to having these conveniences on Channels as well.

from phoenix_guides.

lancehalvorsen avatar lancehalvorsen commented on May 20, 2024

I just opened up PR #238 as a skeleton for this.

I'm working on the intro now, and will head into the models and controllers in turn. The larger plan is to use the the HTML resource we built for ecto models as a jumping off place because a) folks should be familiar with the code already, and b) there are already tests in place that we can add on to. :^)

from phoenix_guides.

gjaldon avatar gjaldon commented on May 20, 2024

Would you like some help here, @lancehalvorsen? I've had the chance to use Phoenix.ChannelTest when working with the channel generator in Phoenix and have used ConnTest and ModelCase in an app I'm building.

from phoenix_guides.

lancehalvorsen avatar lancehalvorsen commented on May 20, 2024

Yes, please! Thanks so much for the offer, @gjaldon. :)

from phoenix_guides.

lancehalvorsen avatar lancehalvorsen commented on May 20, 2024

@gjaldon, I just closed this #152, but there may still be things you can use from it. @paulcsmith has kindly offered it up if it's useful.

from phoenix_guides.

paulcsmith avatar paulcsmith commented on May 20, 2024

@gjaldon LMK if you need any help with the channel guide. As @lancehalvorsen mentioned, the one I started might be a good outline for the new one

from phoenix_guides.

gjaldon avatar gjaldon commented on May 20, 2024

@paulcsmith thanks! Will let you know if I get stuck and will likely use the one you started as outline.

from phoenix_guides.

jsncmgs1 avatar jsncmgs1 commented on May 20, 2024

I'm going to start on a guide for Controller specs, specifically testing JSON responses. I personally never write controller tests if I'm rendering templates (I write feature tests), so if someone else would like to tackle that chunk that would be great. If not, I'll do it after I'm done with the JSON stuff.

Or perhaps the guide for testing non API controllers is a guide on features tests?

from phoenix_guides.

jsncmgs1 avatar jsncmgs1 commented on May 20, 2024

Also, I feel like we should have a task list so we have a goal to work toward for closing this:

  • Controller Tests
  • Feature Tests ??

Given that Models and Channels already have a guide, I feel like once we have these checked off that's the core of what people are generally testing, and other things like Routes, Mailers, can have their own issues.

from phoenix_guides.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.