If you're running your tests in the browser bundled with webpack (or similar)
dom-testing-library should work out of the box for you. However, most
dom-testing-library are using it with
the Jest testing framework with the
(which is the default configuration with Jest).
Using Without Jest
First, install jsdom and jsdom-global.
npm install --save-dev jsdom jsdom-global
With mocha, the test command would look something like this:
mocha --require jsdom-global/register
Note, depending on the version of Node you're running, you may also need to install
@babel/polyfill(if you're using babel 7) or
babel-polyfill(for babel 6).