Closed DFurnes closed 4 years ago
Tests were running awfully slow – was able to get them up to speed in d551214 by swapping Jest's test environment to node
(rather than the default jsdom
, which spins up a virtual DOM environment) & sharing a single local-dynamo
server between all test runs.
@DFurnes Added a bunch of n00b questions, and want to do two things before giving this the 👍:
The second thing shouldn't be a blocker to approval though.
Setup locally to test the setup
This will probably not be all too exciting, since there aren't any endpoints to actually use. But I'd be happy to pair with you on setting this up once I get one of the follow-up PRs pushed!
What's this PR do?
This pull request kicks off the Bertly 2.0 rewrite in Node.js & DynamoDB. This just sets up all the things we'll need for development later on... our "framework", if you will!
Here's where we'll end up (with the functions themselves to come in follow-up PRs):
How should this be reviewed?
This pull request is broken up into commits to separate some of the noisier "cruft" (setting up the local development environment, file structure, and server) from the "meat" of the application:
🐭 Adds an EditorConfig, because we didn't have one! a5a9cda
⚙️ Updates
.env.example
and adds aconfig/
directory. This follows the pattern we've established in DoSomething/graphql, and makes it easier to understand what configuration options this app offers at a glance. f2874c6💰 Adds dependencies & configures Babel (mainly for ES Modules) & Prettier. 38c7025
🐚 Adds the basic Express application shell & middleware. This is exported and used by our three different "entry points" – interactive local development, the Jest test suite, and Lambda functions. Also includes basic 404 & error handler middleware. 8d60b4f
💻 Adds a "local" entry point & configures local-dynamo server so that we can run this without messing with real AWS resources. This database is persisted in
bootstrap/storage/database/
between runs. 667a0b4🚥 Configures Jest's test runner & adds some helpers for writing functional tests for this application (where we make a HTTP request & assert something happened). I've also added a simple
dropTable
andfresh
helpers for testing, inspired by Laravel. a2d46d4Any background context you want to provide?
Originally had the actual endpoints & database model in here as well, but removed those for follow-up PRs in order to keep this a bit more manageable to review.
Relevant tickets
References Pivotal #169047065.
Checklist