Closed michael closed 8 years ago
We needed a modular backend seeding strategy for testing. Seeds can be specified as JSON and look like this:
// substance/test/fixtures/collab/backendSeed.js var twoParagraphs = require('./two-paragraphs'); var testSeed = { users: { 'test': { userId: 'test', name: 'Test user', loginKey: '1234' } }, changesets: { 'test-doc': twoParagraphs.createChangeset() } };
Backend provides a method seed which is used during testing and in seed.js.
seed.js
Setup: Check out the backend-tests branch of the Notes app and npm link substance which is at branch collab-improvements.
backend-tests
collab-improvements
Your first task is to make the initial seeding work again using the new API.
node seed.js
Implementation should go here: https://github.com/substance/notes/blob/backend-tests/server/Backend.js#L337-L351
You may also need to touch: https://github.com/substance/notes/blob/backend-tests/seed.js
More tasks are coming soon.
Oh and pls work on a branch and make PR into backend-tests.
I did ignore userId from your fixture as it is incremental thing.
That's done.
We needed a modular backend seeding strategy for testing. Seeds can be specified as JSON and look like this:
Backend provides a method seed which is used during testing and in
seed.js
.Setup: Check out the
backend-tests
branch of the Notes app and npm link substance which is at branchcollab-improvements
.Your first task is to make the initial seeding work again using the new API.
node seed.js
Implementation should go here: https://github.com/substance/notes/blob/backend-tests/server/Backend.js#L337-L351
You may also need to touch: https://github.com/substance/notes/blob/backend-tests/seed.js
More tasks are coming soon.