Commit Graph

17 Commits

Author SHA1 Message Date
Christian Bundy c86865a5ca Add more comprehensive tests
Problem: I've been worried about merging these version bump pull
requests since we don't have many tests, and I *really* don't want to
merge any catostrophic breaking changes anywhere.

Solution: Add some tests that are more comprehensive, starting by
creating a temporary SSB database and keypair and then editing the
profile, previewing a message, publishing a message, etc., until we have
a handful of small functions actually being tested. This won't ensure
that everything works forever, and it *really* doesn't test replication,
but it should help increase our confidence that test success means that
fewer things are broken.
2020-11-22 15:35:15 -08:00
Christian Bundy e94d7ac2ba Remove unused fixtures
Problem: These fixtures seem unused.

Solution: DELETE THEM!
2020-11-20 16:42:07 -08:00
Alexander Cobleigh d88d960c52 reset test/basic.js
this time without cryptix's basic blob test (to see if CI completes)
2020-10-21 14:53:18 +02:00
Henry 4884f264fd add simple test for blob uploads 2020-10-19 10:06:35 +02:00
Henry e7dd215f4d fix common-good setup
somehow it's cli arguments changed
2020-10-19 10:06:34 +02:00
Daan Wynen a40b2eefc1 make the linters happy.
this time they had a *lot* of opinions. :P
2020-05-23 21:14:49 +02:00
Christian Bundy 627e1b3c76 Add tests for CSRF and DNS rebind
Problem: We had these problems in the past and we can't have them again.
Solution: Tests make it really easy to double-check that we remain immune.
2020-04-10 12:33:22 -07:00
Christian Bundy 2968f7d80a Merge https://github.com/fraction/oasis into advisory-fix-1 2020-04-10 10:51:29 -07:00
Christian Bundy 7d168f8de3 Fix Windows test on Travis CI
Problem: There's an intermittent test failure on Travis CI that seems on
only happen when we have two test suites. Since the lifecycle suite only
tests a subset of the basic test, we can safely remove it without
compromising any test coverage.

Solution: Remove the redundant lifecycle test and try not to think about
the problem too much. Maybe in the future when we need a second test
suite we can resolve this problem, or maybe the underlying bug will be
resolved downstream (e.g. https://github.com/tapjs/node-tap/pull/662),
but right now I think the benefits of "no intermittent test failures"
outweights the costs of "all tests must go in one file".
2020-04-08 10:23:27 -07:00
Christian Bundy 8582dc40f8 Attempt fixing Windows test
Problem: For some reason the Windows test is timing out but I'm really
not sure why.

Solution: Try to make the lifecycle test copy the basic test.
2020-04-06 15:17:21 -07:00
Christian Bundy 3886b1fc53 Increase test timeout and remove log statements
Problem: The Windows tests seem to be failing, it looks like a timeout
problem? Also there are a handful of debug statements around the code
that can be safely removed.

Solution: Double the timeout length and remove debug statements.
2020-04-06 13:22:07 -07:00
Christian Bundy cb1be6bc8b Fix open sockets that weren't closing during tests
Problem: The test suite isn't closing the database because `app.close()`
only affects the HTTP server. This means that tests don't exit cleanly
and sockets remain open and all sorts of really fun stuff that we don't
want while writing tests.

Solution: Refactor `src/ssb.js` so that we can exit cleanly and have
less rope to hang ourselves with. Add a small lifecycle test that can
help us ensure that the bare minimum lifecycle events are working
correctly, plus now the previous tests are passing on my machine too.
2020-04-06 12:14:58 -07:00
Christian Bundy 3c9ec37d2f Add very basic test suite
Problem: ESLint and TypeScript help catch some types of regressions, but
they don't protect us against obvious stuff like "the server won't
start". This means that humans need to test a bunch of stuff manually,
and that can be really tedious and exhausting.

Solution: Yesterday someone invented this cool concept called "testing"
where you write automated tests for your software to ensure it actually
works the way you expect. It might have beeen invented before yesterday,
I don't know. Anyway, this solution adds a bunch of tests that send HTTP
GET requests to a bunch of endpoints to make sure the server is at least
returning HTTP 200 responses. It also fixes a race condition where HTTP
server was available before the readme / version strings were loaded.
2020-04-03 09:17:13 -07:00
Christian Bundy 4a9361a8b6
Refactor SSB distro into @fraction/flotilla module 2019-09-16 13:41:20 -07:00
Christian Bundy 5b115f5004
Add spell-check for Markdown files in project 2019-08-13 14:40:08 -07:00
Christian Bundy 3a11162455
Fix ssb-msgs broken from mechanical edit 2019-06-27 15:07:09 -07:00
Christian Bundy 762cc50f9a
Add cspell and use real English words 2019-06-27 14:54:32 -07:00