A collection of Sequelize tests and experiments, along with scripts to make it easy to create new ones
Each test exists in its own pg schema. After the test has been run for the first time future runs should be idempotent.
- Clone this repository
- Run
tests/setup.sh
(sudo's to the postgres user) - Run
tests/xx-test-dir/run.sh
(sudo's to drop if exists and then create the test schema)
Pull requests are always welcome. When writing a new test:
- Create a directory, incrementing the test number and giving it a short description
- In the test's package.json specify its name, description and any npm packages that it uses
- Using an existing test's
run.sh
and*.js
files as a base, modify the schema and make any changes necessary. Typically:
run.sh
sources the DB user name, DB user password and DB name fromtests/config.sh
run.sh
calls out to node to execute any JS scripts associated with the test, these scripts may need to specify the schema as well
sequelize-playground is configured to use pg as a backing store. To change it to use another one instead or as well, modify and re-run tests/setup.sh
so that future tests using the other backing store can execute independently of each other. Re-running an unmodified tests/setup.sh
will delete all existing test results in the PG database.