Giter Site home page Giter Site logo

Comments (4)

tgriesser avatar tgriesser commented on July 30, 2024

@jblebrun - if you do $ export KNEX_DEV=1 like you would with the path for the db config, then the same function which normally verifies the test output when you're running the tests instead dumps the values from the query into the test file as appropriate (you don't need to write any of them by hand, it re-numbers for you)...

So my reasoning was that the organization shouldn't really matter here, it was just so you could look them up when looking at the string output you could jump down to the value output easily since they're named the same.

Let me know if this makes sense.

from knex.

jblebrun avatar jblebrun commented on July 30, 2024

I see. Do you have a procedure for making sure that previously confirmed test results haven't changed? For example, isn't it possible that in developing a new feature, another test output might change unexpectedly, but since the entire output gets re-generated in generating the results for the new test case, you'd have to be on the lookout for that. I suppose visually scanning a git diff of the file would suffice?

It might be useful to other contributors to provide a quick summary of your process (e.g. a README in the test dir) for adding/verifying new test cases, so that others can be sure to follow the same procedure to remain consistent with your process.

from knex.

tgriesser avatar tgriesser commented on July 30, 2024

I figured that visually checking the diff would be quicker and actually less error prone than doing it by hand...

I did have this sort of mentioned in the test FAQ section... though I could probably word it better or put it in a README in the tests dir as you mentioned:

If you're going to add a test, you may want to follow similar patterns, used in the test suite, setting $ export BOOKSHELF_DEV=1 to save the outputs data from the tests into the shared/output.js file.

from knex.

jblebrun avatar jblebrun commented on July 30, 2024

Oh, I guess I should've taken a better look at the FAQ!

from knex.

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.