Comments (4)
@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.
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.
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.
Oh, I guess I should've taken a better look at the FAQ!
from knex.
Related Issues (20)
- Add comments to promise aware knex transaction commits
- Using Jest with Knex, I get 'Error: Unable to acquire a connection' every time HOT 1
- Parse a query string back to QueryBuilder object?
- Transaction method resolves if the provided callback rejects with `undefined`.
- insert() with typescript
- Casing issues
- connection string isn't working
- Raw query HOT 6
- directory option should take absolute paths HOT 1
- limit() is not working with delete()
- Update multiple fields. One field not updated sometimes
- Wrong TypeScript type when using .count('*')
- pglite support
- esm migrations does not work on Node 22
- Straightforward way of getting the PID of a query, ahead-of-time.
- can't extend existing method
- Error without actual reason in CLI due to TypeScript error
- Unknown pending operation error HOT 1
- Mysql forShare query compiler error
- `timestamps` method signature in schema is misleading
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knex.