hubmapconsortium / portal-ui

HuBMAP Data Portal front end
https://portal.hubmapconsortium.org
MIT License
12 stars 2 forks source link

Get `npm test` working, and add to travis #792

Closed mccalluc closed 4 years ago

mccalluc commented 4 years ago

@john-conroy : I hadn't realized we weren't actually running this from travis right now... but you said you'd look at JS tests today, so you may already be on this.

In the end we want to make sure test pass locally and on travis.

$ npm test

> portal-ui@ test /Users/chuck/github/hubmap/portal-ui/context
> jest

 PASS  app/static/js/helpers/__tests__/tableToDelimitedString.spec.js
 FAIL  app/static/js/components/Detail/Attribution/Attribution.spec.js
  ● Test suite failed to run

    /Users/chuck/github/hubmap/portal-ui/context/node_modules/typeface-inter/Inter (web)/Inter.var.woff2:1
    wOF2

    SyntaxError: Invalid or unexpected token
        at compileFunction (<anonymous>)

      1 | import { createGlobalStyle } from 'styled-components';
      2 |
    > 3 | import InterVariable from 'typeface-inter/Inter (web)/Inter.var.woff2';
        | ^
      4 |
      5 | export default createGlobalStyle`
      6 |     @supports (font-variation-settings: normal) {

      at Runtime._execModule (node_modules/jest-runtime/build/index.js:1166:56)
      at Object.<anonymous> (app/static/js/fonts.js:3:1)
      at Object.<anonymous> (app/static/js/components/Providers.jsx:8:1)
      at Object.<anonymous> (test-utils/functions.js:5:1)
      at Object.<anonymous> (app/static/js/components/Detail/Attribution/Attribution.spec.js:3:1)

 FAIL  app/static/js/components/Detail/Dataset/Dataset.spec.js
john-conroy commented 4 years ago

I think I've mentioned before, but perhaps I didn't outline it clearly in an issue. We need to fix prov-vis before this is possible. There are issues running tests in the portal due to the version of prov-vis we're using not including the schema.json, but upgrading to the version of prov-vis which does include schema.json breaks a lot of the graphs for other reasons.

john-conroy commented 4 years ago

Fixed in #871