UI: npm test fails with an error
See original GitHub issuenpm test
fails with an error: ` …BaGet.UI\node_modules\office-ui-fabric-react\lib\Icon.js:1 ({“Object.<anonymous>”:function(module,exports,require,__dirname,__filename,global,jest){export * from ‘./components/Icon/index’; ^^^^^^
SyntaxError: Unexpected token export
1 | import { HtmlRenderer, Parser } from ‘commonmark’;
2 | import { Icon } from ‘office-ui-fabric-react/lib/Icon’; | ^ 3 | import * as React from ‘react’; 4 | import timeago from ‘timeago.js’; 5 | import LicenseInfo from ‘./LicenseInfo’;
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17) at Object.<anonymous> (src/DisplayPackage.tsx:2:1) `
similar to this https://github.com/facebook/jest/issues/2550
I have updated npms to the latest but it does not resolve the issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top GitHub Comments
Sounds good to me
Good question! This can be used by two things:
/upload
would become/my-prefix/upload
). We’re working on a fix to this problem here, it works by replacing that__BAGET_PLACEHOLDER_API_URL__
value as we serve the BaGet react app.https://my-baget-api
, you can create a deployment step where you replace__BAGET_PLACEHOLDER_API_URL__
withhttps://my-get-api
. This is a hidden feature that I should document 😃Hm. Could you use custom environment variables (see this) to override the API URL?
awesome, I’ll make a branch and start working on this new features and fill an issue next week to keep track. I’ll fix the tests and code a few ones. React testing isn’t my strongest front-end test unit but I’m sure we can improve what we have here 😉