Skip to content

Move some test setup/teardown to a central location. #111

@collin

Description

@collin

I've had a number of groups who end up with quite a bit more test set-up and tear down needs.

To these students I have recommended they add a central ./test-setup.jsand instruct mocha to load this file explicitly and first.

Things that move into this file are setting up globally used mock adapters, the enzyme adapter, and database setup/teardown tasks.

"NODE_ENV='test' mocha ./test-setup \"./server/**/*.spec.js\" \"./client/**/*.spec.js\" \"./script/**/*.spec.js\" --require @babel/polyfill --require @babel/register
// test-setup.js
// with these and other hooks at the top-level.
before(() => db.sync({ force: true });
afterEach(() => db.sync({ force: true });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions