GithubHelp home page GithubHelp logo

Comments (2)

jwarwick avatar jwarwick commented on June 1, 2024

I've started to think about how to remove the test fixtures from ex_doc. I could use some guidance on the best way to proceed. It's easy enough to put all the test fixtures into test_helper.exs, though I'm not sure that's much of a win in terms of understandability. I could move individual modules into the specific test files (or even into the test functions in some cases), though I think there would be a fair amount of repeated code in those cases.

Any high-level guidance on which of these approaches makes more sense?

We will still need a small number of test fixtures to test the file and directory reading code (unless there is some advantage to auto-generating those as well).

from ex_doc.

josevalim avatar josevalim commented on June 1, 2024

@jwarwick I think we should have a mixture of both approaches. Some fixtures could be used throughout the whole codebase and therefore should be defined in test_helper.exs but some other fixtures could be define in modules or, as you said, even in particular tests since one of the goals is to decouple the tests.

This is actually the general approach for using fixtures: a minimum global set of fixtures with variations being defined specifically for each test. :)

from ex_doc.

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.