atproto icon indicating copy to clipboard operation
atproto copied to clipboard

test (api, common, common-web): add further tests

Open 43081j opened this issue 1 year ago • 4 comments

just getting my head around the repo out of curiosity, so i filled in some test gaps while i was there

let me know if there's anything you want changing, and if you want this

fwiw too the agent tests could be better to purge the in-memory db between tests. you spin up a single db before the entire suite presumably to save time/resources. however, it means tests can pollute each others' state, and you end up with these ever-incrementing user IDs in your test cases to avoid conflicts.

would be much better if you could afterEach(() => server.ctx.db.clear()) somehow

43081j avatar May 01 '23 21:05 43081j

ah some linting errors. would you mind fixing?

think you should be able to fix with yarn verify:fix

dholms avatar May 02 '23 01:05 dholms

Read through these and all looked good— appreciate it!

devinivy avatar May 02 '23 02:05 devinivy

Sure no worries, will try push the fix today

& Yeah I did notice the tests felt very integration-like. There's probably a fair amount of stuff you can test and just stub out the underlying server rather than launching a real one. Might be an option in future

43081j avatar May 02 '23 06:05 43081j

@dholms should be fixed now, can you approve the ci run again?

43081j avatar May 02 '23 17:05 43081j

lost track of this one - thanks for the fixes! merging now 👍

dholms avatar May 12 '23 22:05 dholms