fix coverage reports for canvas-rce

refs KNO-308
flag=none

https://gerrit.instructure.com/c/canvas-lms/+/223471 added a reference to
the window object, and that package's mocha tests weren't configured
properly. This commit registers jsdom for the tests, injecting the needed
window

test plan:
  - from canvas root, run (cd packages/canvas-rce/; yarn test:coverage)
    - tests should run
  - running RUN_TESTS_FIRST=1 yarn test:coverage from root should at least
    make it past that package

qa risk: low

Change-Id: I86a3acc921644533ac381254aea376a833a6ec8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228134
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Ben Nelson <bnelson@instructure.com>
This commit is contained in:
Davis Hyer 2020-02-26 17:25:04 -07:00
parent 7c152d6839
commit 64bb26477e
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@
"test:cafe:all": "yarn build:cafe && testcafe chrome,firefox,safari testcafe/**/*.test.js",
"test:cafe:debug": "testcafe --inspect-brk chrome testcafe/**/*.test.js",
"test:watch": "BABEL_ENV=test-node mocha 'test/**/*.test.js' --require @instructure/canvas-theme --require @babel/register --watch",
"test:coverage": "cross-env BABEL_ENV=test-node nyc -r html -r json node_modules/.bin/mocha 'test/**/*.test.js'",
"test:coverage": "cross-env BABEL_ENV=test-node nyc -r html -r json node_modules/.bin/mocha -r jsdom-global/register 'test/**/*.test.js'",
"test:jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
"debug": "BABEL_ENV=test-node inspect _mocha --no-timeouts --debug-brk 'test/**/*.test.js' --require @instructure/canvas-theme --require @babel/register",
"demo": "webpack -p",