Simple Object.js ORM example copied from Vincit/objection.js
This example was copied from folder examples/express-es7 of github.com/Vincit/objection.js. See Objection.js docs
The original client code that makes HTTP requests is in client.js but for this demo we are going to use Cypress Test Runner with @bahmutov/cy-api plugin.
npm ci
To start local server and open Cypress
npm run dev
There are several specs in cypress/integration folder
- movies-spec.js shows how to add a new movie, and how the API checks for required fields to be present
- spec.js shows complex calls to insert multiple entities in a single call, updating multiple objects using "upsert"
- Read "Black box API testing with server logs" post.
- see another example server-logs-example
Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2019
Original License: See github.com/Vincit/objection.js Additions showing logs and Cypress tests under MIT License - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github