@equinor/echo-cli 1.0.0-beta-9 → 1.0.0-beta-11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/echo-dev-host/package.json +1 -1
  2. package/echo-dev-host/public/index.css +60 -60
  3. package/echo-dev-host/src/api/api-plants.ts +22 -22
  4. package/echo-dev-host/src/app.css +12 -12
  5. package/echo-dev-host/src/app.tsx +43 -43
  6. package/echo-dev-host/src/components/Home/Home.tsx +23 -23
  7. package/echo-dev-host/src/components/Home/home.module.css +38 -38
  8. package/echo-dev-host/src/components/legend.tsx +3 -3
  9. package/echo-dev-host/src/index.tsx +90 -90
  10. package/echo-dev-host/src/setupTests.ts +25 -25
  11. package/echo-dev-host/src/utils/plants.test.ts +33 -33
  12. package/echo-dev-host/src/utils/plants.ts +12 -12
  13. package/echo-dev-host/src/utils/setupSkipAuth.ts +43 -43
  14. package/lib/echo-build-dev-host.d.ts +1 -1
  15. package/lib/echo-build-dev-host.js +1 -1
  16. package/lib/echo-build-dev-host.js.map +1 -1
  17. package/lib/echo-build.d.ts +5 -5
  18. package/lib/echo-build.js +10 -6
  19. package/lib/echo-build.js.map +1 -1
  20. package/lib/echo-create.d.ts +9 -9
  21. package/lib/echo-create.js +10 -10
  22. package/lib/echo-create.js.map +1 -1
  23. package/lib/echo-dev-host/package.json +1 -1
  24. package/lib/echo-dev-host/public/index.css +60 -60
  25. package/lib/echo-dev-host/src/api/api-plants.ts +22 -22
  26. package/lib/echo-dev-host/src/app.css +12 -12
  27. package/lib/echo-dev-host/src/app.tsx +43 -43
  28. package/lib/echo-dev-host/src/components/Home/Home.tsx +23 -23
  29. package/lib/echo-dev-host/src/components/Home/home.module.css +38 -38
  30. package/lib/echo-dev-host/src/components/legend.tsx +3 -3
  31. package/lib/echo-dev-host/src/index.tsx +90 -90
  32. package/lib/echo-dev-host/src/setupTests.ts +25 -25
  33. package/lib/echo-dev-host/src/utils/plants.test.ts +33 -33
  34. package/lib/echo-dev-host/src/utils/plants.ts +12 -12
  35. package/lib/echo-dev-host/src/utils/setupSkipAuth.ts +43 -43
  36. package/lib/echo-manifest.d.ts +1 -1
  37. package/lib/echo-manifest.js +1 -1
  38. package/lib/echo-manifest.js.map +1 -1
  39. package/lib/echo-update-dev-host-deps.d.ts +2 -2
  40. package/lib/echo-update-dev-host-deps.js +3 -3
  41. package/lib/echo-update-dev-host-deps.js.map +1 -1
  42. package/lib/tools/buildScripts/buildAndCopyDevHost.js +1 -1
  43. package/lib/tools/buildScripts/buildAndCopyDevHost.js.map +1 -1
  44. package/lib/utils/printDevHostVersions.js +5 -6
  45. package/lib/utils/printDevHostVersions.js.map +1 -1
  46. package/package.json +3 -3
@@ -48,7 +48,7 @@
48
48
  "zustand": "4.5.5"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/core": "7.27.1",
51
+ "@babel/core": "7.28.0",
52
52
  "@babel/plugin-transform-runtime": "7.27.1",
53
53
  "@babel/polyfill": "7.12.1",
54
54
  "@babel/preset-env": "7.27.2",
@@ -1,60 +1,60 @@
1
- body {
2
- overflow: hidden;
3
- margin: 0;
4
- }
5
-
6
- .highlightedText {
7
- background: yellow;
8
- color: black;
9
- padding: 0;
10
- }
11
-
12
- #rootloading {
13
- display: flex;
14
- flex-direction: column;
15
- color: #ff1243;
16
- justify-content: center;
17
- align-items: center;
18
- text-align: center;
19
- position: absolute;
20
- width: 100%;
21
- height: 100%;
22
- }
23
-
24
- .loaderContainer {
25
- margin: 8px auto;
26
- display: flex;
27
- flex-direction: column;
28
- padding-top: 0;
29
- }
30
-
31
- .productLogo {
32
- flex: 1;
33
- margin-bottom: 4rem;
34
- text-align: left;
35
- }
36
-
37
- .productLogoImg {
38
- display: inline-block;
39
- vertical-align: baseline;
40
- width: 122px;
41
- animation: fadeIn 0.5s;
42
- }
43
-
44
- .equinorLogo {
45
- margin: 0 auto;
46
- display: inline-block;
47
- vertical-align: baseline;
48
- width: 64px;
49
- height: 64px;
50
- animation: fadeIn 0.5s;
51
- }
52
-
53
- @keyframes fadeIn {
54
- 0% {
55
- opacity: 0;
56
- }
57
- 100% {
58
- opacity: 1;
59
- }
60
- }
1
+ body {
2
+ overflow: hidden;
3
+ margin: 0;
4
+ }
5
+
6
+ .highlightedText {
7
+ background: yellow;
8
+ color: black;
9
+ padding: 0;
10
+ }
11
+
12
+ #rootloading {
13
+ display: flex;
14
+ flex-direction: column;
15
+ color: #ff1243;
16
+ justify-content: center;
17
+ align-items: center;
18
+ text-align: center;
19
+ position: absolute;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ .loaderContainer {
25
+ margin: 8px auto;
26
+ display: flex;
27
+ flex-direction: column;
28
+ padding-top: 0;
29
+ }
30
+
31
+ .productLogo {
32
+ flex: 1;
33
+ margin-bottom: 4rem;
34
+ text-align: left;
35
+ }
36
+
37
+ .productLogoImg {
38
+ display: inline-block;
39
+ vertical-align: baseline;
40
+ width: 122px;
41
+ animation: fadeIn 0.5s;
42
+ }
43
+
44
+ .equinorLogo {
45
+ margin: 0 auto;
46
+ display: inline-block;
47
+ vertical-align: baseline;
48
+ width: 64px;
49
+ height: 64px;
50
+ animation: fadeIn 0.5s;
51
+ }
52
+
53
+ @keyframes fadeIn {
54
+ 0% {
55
+ opacity: 0;
56
+ }
57
+ 100% {
58
+ opacity: 1;
59
+ }
60
+ }
@@ -1,22 +1,22 @@
1
- import { EchoEnv, Plant, request, setPlantsData } from '@equinor/echo-core';
2
-
3
- async function getPlantsFromApi(): Promise<Plant[] | undefined> {
4
- const url = `${EchoEnv.env().REACT_APP_API_URL}/plants`;
5
- return request<Plant[]>({
6
- url, cache: {
7
- timeInSeconds: 4 * 60 * 60 // 4 hours
8
- }
9
- });
10
- }
11
-
12
- export async function getCorePlants(): Promise<void> {
13
- try {
14
- const apiPlants = (await getPlantsFromApi() ?? []);
15
-
16
- if (apiPlants && apiPlants.length > 0) {
17
- setPlantsData({ plants: apiPlants });
18
- }
19
- } catch (ex) {
20
- console.error(ex);
21
- }
22
- }
1
+ import { EchoEnv, Plant, request, setPlantsData } from '@equinor/echo-core';
2
+
3
+ async function getPlantsFromApi(): Promise<Plant[] | undefined> {
4
+ const url = `${EchoEnv.env().REACT_APP_API_URL}/plants`;
5
+ return request<Plant[]>({
6
+ url, cache: {
7
+ timeInSeconds: 4 * 60 * 60 // 4 hours
8
+ }
9
+ });
10
+ }
11
+
12
+ export async function getCorePlants(): Promise<void> {
13
+ try {
14
+ const apiPlants = (await getPlantsFromApi() ?? []);
15
+
16
+ if (apiPlants && apiPlants.length > 0) {
17
+ setPlantsData({ plants: apiPlants });
18
+ }
19
+ } catch (ex) {
20
+ console.error(ex);
21
+ }
22
+ }
@@ -1,12 +1,12 @@
1
- /* Applied in echo application by bootstrap so it should exist here to */
2
- *,
3
- :after,
4
- :before {
5
- box-sizing: border-box;
6
- }
7
-
8
- #root {
9
- height: 100%;
10
- overflow: hidden;
11
- width: 100%;
12
- }
1
+ /* Applied in echo application by bootstrap so it should exist here to */
2
+ *,
3
+ :after,
4
+ :before {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ #root {
9
+ height: 100%;
10
+ overflow: hidden;
11
+ width: 100%;
12
+ }
@@ -1,43 +1,43 @@
1
- import { EchoEnv, useInitial } from '@equinor/echo-core';
2
- import { displayToast, EchoContent, EchoEventHandler, EchoRoutes, Toasters } from '@equinor/echo-framework';
3
- import { Syncer } from '@equinor/echo-search';
4
- import React from 'react';
5
- import { Redirect as TypedRedirect, Route as TypedRoute, Switch as TypedSwitch } from 'react-router-dom';
6
- import { getCorePlants } from './api/api-plants';
7
- import './app.css';
8
- import { Home } from './components/Home/Home';
9
- import { Legend } from './components/legend';
10
-
11
- export const EchoApp: React.FC = () => {
12
- useInitial(async () => {
13
- await Syncer.configuration.setApiBaseUrl(EchoEnv.env().REACT_APP_API_URL);
14
- fireAndForget(getCorePlants, {
15
- userFriendlyErrorMessage: '[echo-dev-host][app.tsx] Failed to load plants data',
16
- displayToast: true
17
- });
18
- });
19
-
20
- return (
21
- <EchoEventHandler>
22
- <EchoContent Legend={Legend} isOnboardingCompleted={true}>
23
- <TypedSwitch>
24
- <EchoRoutes homeComponent={Home} />
25
- <TypedRoute render={(): JSX.Element => <TypedRedirect to="/" />} />
26
- </TypedSwitch>
27
- <Toasters />
28
- </EchoContent>
29
- </EchoEventHandler>
30
- );
31
- };
32
-
33
- function fireAndForget(
34
- asyncFunc: () => Promise<void>,
35
- options: { userFriendlyErrorMessage: string; displayToast?: boolean }
36
- ): void {
37
- asyncFunc().catch((error) => {
38
- console.error(error, options.userFriendlyErrorMessage);
39
- if (options.displayToast) {
40
- displayToast({ message: options.userFriendlyErrorMessage });
41
- }
42
- });
43
- }
1
+ import { EchoEnv, useInitial } from '@equinor/echo-core';
2
+ import { displayToast, EchoContent, EchoEventHandler, EchoRoutes, Toasters } from '@equinor/echo-framework';
3
+ import { Syncer } from '@equinor/echo-search';
4
+ import React from 'react';
5
+ import { Redirect as TypedRedirect, Route as TypedRoute, Switch as TypedSwitch } from 'react-router-dom';
6
+ import { getCorePlants } from './api/api-plants';
7
+ import './app.css';
8
+ import { Home } from './components/Home/Home';
9
+ import { Legend } from './components/legend';
10
+
11
+ export const EchoApp: React.FC = () => {
12
+ useInitial(async () => {
13
+ await Syncer.configuration.setApiBaseUrl(EchoEnv.env().REACT_APP_API_URL);
14
+ fireAndForget(getCorePlants, {
15
+ userFriendlyErrorMessage: '[echo-dev-host][app.tsx] Failed to load plants data',
16
+ displayToast: true
17
+ });
18
+ });
19
+
20
+ return (
21
+ <EchoEventHandler>
22
+ <EchoContent Legend={Legend} isOnboardingCompleted={true}>
23
+ <TypedSwitch>
24
+ <EchoRoutes homeComponent={Home} />
25
+ <TypedRoute render={(): JSX.Element => <TypedRedirect to="/" />} />
26
+ </TypedSwitch>
27
+ <Toasters />
28
+ </EchoContent>
29
+ </EchoEventHandler>
30
+ );
31
+ };
32
+
33
+ function fireAndForget(
34
+ asyncFunc: () => Promise<void>,
35
+ options: { userFriendlyErrorMessage: string; displayToast?: boolean }
36
+ ): void {
37
+ asyncFunc().catch((error) => {
38
+ console.error(error, options.userFriendlyErrorMessage);
39
+ if (options.displayToast) {
40
+ displayToast({ message: options.userFriendlyErrorMessage });
41
+ }
42
+ });
43
+ }
@@ -1,23 +1,23 @@
1
- import { AppLinks, EchoLogo, Footer, PlantSelector } from '@equinor/echo-framework';
2
- import React from 'react';
3
- import placeholderHomeImage from '../../images/frontpage-brand-placeholder.jpg';
4
- import style from './home.module.css';
5
-
6
- export const Home: React.FC = () => {
7
- return (
8
- <main className={style.home}>
9
- <div className={style.plantSelector}>
10
- <div>
11
- <EchoLogo />
12
- </div>
13
-
14
- <PlantSelector />
15
- </div>
16
- <AppLinks />
17
- <div className={style.brandSliderContainer}>
18
- <img src={placeholderHomeImage} alt="Application Echo on tablet" />
19
- </div>
20
- <Footer />
21
- </main>
22
- );
23
- };
1
+ import { AppLinks, EchoLogo, Footer, PlantSelector } from '@equinor/echo-framework';
2
+ import React from 'react';
3
+ import placeholderHomeImage from '../../images/frontpage-brand-placeholder.jpg';
4
+ import style from './home.module.css';
5
+
6
+ export const Home: React.FC = () => {
7
+ return (
8
+ <main className={style.home}>
9
+ <div className={style.plantSelector}>
10
+ <div>
11
+ <EchoLogo />
12
+ </div>
13
+
14
+ <PlantSelector />
15
+ </div>
16
+ <AppLinks />
17
+ <div className={style.brandSliderContainer}>
18
+ <img src={placeholderHomeImage} alt="Application Echo on tablet" />
19
+ </div>
20
+ <Footer />
21
+ </main>
22
+ );
23
+ };
@@ -1,38 +1,38 @@
1
- .home {
2
- display: grid;
3
- grid-template-rows: 30% 100px auto 56px;
4
- gap: 1rem;
5
- height: 100%;
6
- width: 100%;
7
- }
8
-
9
- .plantSelector {
10
- display: flex;
11
- justify-content: center;
12
- align-items: baseline;
13
- align-self: center;
14
- flex-flow: wrap;
15
- }
16
-
17
- .heading {
18
- padding-left: 18px;
19
- }
20
-
21
- .brandSliderContainer {
22
- display: flex;
23
- flex: 1 1;
24
- flex-flow: column-reverse;
25
- margin: 0;
26
- width: 100%;
27
- overflow: hidden;
28
- object-fit: cover;
29
- }
30
-
31
- .appBar {
32
- margin: 0 auto 48px;
33
- display: flex;
34
- flex-wrap: wrap;
35
- justify-content: center;
36
- align-items: flex-start;
37
- }
38
-
1
+ .home {
2
+ display: grid;
3
+ grid-template-rows: 30% 100px auto 56px;
4
+ gap: 1rem;
5
+ height: 100%;
6
+ width: 100%;
7
+ }
8
+
9
+ .plantSelector {
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: baseline;
13
+ align-self: center;
14
+ flex-flow: wrap;
15
+ }
16
+
17
+ .heading {
18
+ padding-left: 18px;
19
+ }
20
+
21
+ .brandSliderContainer {
22
+ display: flex;
23
+ flex: 1 1;
24
+ flex-flow: column-reverse;
25
+ margin: 0;
26
+ width: 100%;
27
+ overflow: hidden;
28
+ object-fit: cover;
29
+ }
30
+
31
+ .appBar {
32
+ margin: 0 auto 48px;
33
+ display: flex;
34
+ flex-wrap: wrap;
35
+ justify-content: center;
36
+ align-items: flex-start;
37
+ }
38
+
@@ -1,3 +1,3 @@
1
- export const Legend: React.FC = () => {
2
- return null;
3
- };
1
+ export const Legend: React.FC = () => {
2
+ return null;
3
+ };
@@ -1,90 +1,90 @@
1
- import { LoadingModuleOptions } from '@equinor/echo-base';
2
- import '@equinor/echo-components/style-reset.css';
3
- import EchoCore, { createEchoAppModuleApi, EventHubProvider, queryClient } from '@equinor/echo-core';
4
- import { mainMenu, Mediator, searchPanel } from '@equinor/echo-framework';
5
- import { Icon } from '@equinor/eds-core-react';
6
- import * as Icons from '@equinor/eds-icons';
7
- import React from 'react';
8
- import { initForE2ETests } from './utils/setupSkipAuth';
9
-
10
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
11
- import { createRoot } from 'react-dom/client';
12
- import { BrowserRouter } from 'react-router-dom';
13
- import { EchoApp } from './app';
14
-
15
- const useEdsIcon = (): void => {
16
- Icon.add({
17
- ...Icons
18
- });
19
- };
20
-
21
- const Echo: React.FC = (): JSX.Element => {
22
- /* Needed to skip authentication when running e2e tests*/
23
- initForE2ETests();
24
-
25
- const isAuthenticated = EchoCore.useEchoSetup({
26
- leftPanels: [searchPanel],
27
- rightPanel: mainMenu
28
- });
29
- useEdsIcon();
30
- const moduleOptions: LoadingModuleOptions = {
31
- createApi: createEchoAppModuleApi(),
32
- dependencies: {
33
- react: require('react'),
34
- 'react-dom': require('react-dom'),
35
- 'react-router-dom': require('react-router-dom'),
36
- '@equinor/echo-core': require('@equinor/echo-core'),
37
- '@equinor/echo-framework': require('@equinor/echo-framework'),
38
- '@equinor/echo-utils': require('@equinor/echo-utils'),
39
- '@equinor/echo-components': require('@equinor/echo-components'),
40
- '@equinor/echo-base': require('@equinor/echo-base'),
41
- '@equinor/echo-search': require('@equinor/echo-search'),
42
- '@equinor/eds-core-react': require('@equinor/eds-core-react'),
43
- '@equinor/eds-icons': require('@equinor/eds-icons'),
44
- 'styled-components': require('styled-components'),
45
- classnames: require('classnames'),
46
- lodash: require('lodash'),
47
- zustand: require('zustand')
48
- },
49
- fetchModules: () => {
50
- return new Promise((resolve) => {
51
- fetch('/echoModuleManifest.json').then((response) => {
52
- response.json().then((manifests) => {
53
- manifests.forEach((manifest) => {
54
- manifest.fileUri = `/index.js`;
55
- });
56
- resolve(manifests);
57
- });
58
- });
59
- });
60
- }
61
- };
62
- return (
63
- <>
64
- {isAuthenticated && (
65
- <EchoCore.AuthProviderComponent>
66
- {/*
67
- Need to cast queryClient to QueryClient because of the following error:
68
- TS2352: Conversion of type 'import("Equinor\\EchopediaWeb\\node_modules\\@tanstack\\query-core\\build\\modern\\hydration-CwYEwyQI").b' to type 'import("Equinor\\EchopediaWeb\\node_modules\\@tanstack\\query-core\\build\\modern\\hydration-BlEK5ylC").b' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
69
- Property '#private' in type 'QueryClient' refers to a different member that cannot be accessed from within type 'QueryClient'.
70
- Based on my research we used the same version of react-query in echopediaWeb and echo-client.
71
- */}
72
- <QueryClientProvider client={queryClient as unknown as QueryClient}>
73
- <EventHubProvider>
74
- <Mediator options={moduleOptions} />
75
- <BrowserRouter>
76
- <EchoApp />
77
- </BrowserRouter>
78
- </EventHubProvider>
79
- </QueryClientProvider>
80
- </EchoCore.AuthProviderComponent>
81
- )}
82
- </>
83
- );
84
- };
85
-
86
- if (!(window !== window.parent && !window.opener)) {
87
- const container = document.getElementById('root') as HTMLElement;
88
- const root = createRoot(container);
89
- root.render(<Echo />);
90
- }
1
+ import { LoadingModuleOptions } from '@equinor/echo-base';
2
+ import '@equinor/echo-components/style-reset.css';
3
+ import EchoCore, { createEchoAppModuleApi, EventHubProvider, queryClient } from '@equinor/echo-core';
4
+ import { mainMenu, Mediator, searchPanel } from '@equinor/echo-framework';
5
+ import { Icon } from '@equinor/eds-core-react';
6
+ import * as Icons from '@equinor/eds-icons';
7
+ import React from 'react';
8
+ import { initForE2ETests } from './utils/setupSkipAuth';
9
+
10
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
11
+ import { createRoot } from 'react-dom/client';
12
+ import { BrowserRouter } from 'react-router-dom';
13
+ import { EchoApp } from './app';
14
+
15
+ const useEdsIcon = (): void => {
16
+ Icon.add({
17
+ ...Icons
18
+ });
19
+ };
20
+
21
+ const Echo: React.FC = (): JSX.Element => {
22
+ /* Needed to skip authentication when running e2e tests*/
23
+ initForE2ETests();
24
+
25
+ const isAuthenticated = EchoCore.useEchoSetup({
26
+ leftPanels: [searchPanel],
27
+ rightPanel: mainMenu
28
+ });
29
+ useEdsIcon();
30
+ const moduleOptions: LoadingModuleOptions = {
31
+ createApi: createEchoAppModuleApi(),
32
+ dependencies: {
33
+ react: require('react'),
34
+ 'react-dom': require('react-dom'),
35
+ 'react-router-dom': require('react-router-dom'),
36
+ '@equinor/echo-core': require('@equinor/echo-core'),
37
+ '@equinor/echo-framework': require('@equinor/echo-framework'),
38
+ '@equinor/echo-utils': require('@equinor/echo-utils'),
39
+ '@equinor/echo-components': require('@equinor/echo-components'),
40
+ '@equinor/echo-base': require('@equinor/echo-base'),
41
+ '@equinor/echo-search': require('@equinor/echo-search'),
42
+ '@equinor/eds-core-react': require('@equinor/eds-core-react'),
43
+ '@equinor/eds-icons': require('@equinor/eds-icons'),
44
+ 'styled-components': require('styled-components'),
45
+ classnames: require('classnames'),
46
+ lodash: require('lodash'),
47
+ zustand: require('zustand')
48
+ },
49
+ fetchModules: () => {
50
+ return new Promise((resolve) => {
51
+ fetch('/echoModuleManifest.json').then((response) => {
52
+ response.json().then((manifests) => {
53
+ manifests.forEach((manifest) => {
54
+ manifest.fileUri = `/index.js`;
55
+ });
56
+ resolve(manifests);
57
+ });
58
+ });
59
+ });
60
+ }
61
+ };
62
+ return (
63
+ <>
64
+ {isAuthenticated && (
65
+ <EchoCore.AuthProviderComponent>
66
+ {/*
67
+ Need to cast queryClient to QueryClient because of the following error:
68
+ TS2352: Conversion of type 'import("Equinor\\EchopediaWeb\\node_modules\\@tanstack\\query-core\\build\\modern\\hydration-CwYEwyQI").b' to type 'import("Equinor\\EchopediaWeb\\node_modules\\@tanstack\\query-core\\build\\modern\\hydration-BlEK5ylC").b' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
69
+ Property '#private' in type 'QueryClient' refers to a different member that cannot be accessed from within type 'QueryClient'.
70
+ Based on my research we used the same version of react-query in echopediaWeb and echo-client.
71
+ */}
72
+ <QueryClientProvider client={queryClient as unknown as QueryClient}>
73
+ <EventHubProvider>
74
+ <Mediator options={moduleOptions} />
75
+ <BrowserRouter>
76
+ <EchoApp />
77
+ </BrowserRouter>
78
+ </EventHubProvider>
79
+ </QueryClientProvider>
80
+ </EchoCore.AuthProviderComponent>
81
+ )}
82
+ </>
83
+ );
84
+ };
85
+
86
+ if (!(window !== window.parent && !window.opener)) {
87
+ const container = document.getElementById('root') as HTMLElement;
88
+ const root = createRoot(container);
89
+ root.render(<Echo />);
90
+ }
@@ -1,25 +1,25 @@
1
- export {};
2
- // Should remove this error: BrowserAuthError: crypto_nonexistent: The crypto object or function is not available. Detail:Browser crypto or msCrypto object not available.
3
- const mGetRandomValues = jest.fn().mockReturnValueOnce(new Uint32Array(10));
4
- Object.defineProperty(window, 'crypto', {
5
- value: { getRandomValues: mGetRandomValues }
6
- });
7
-
8
- jest.mock('@equinor/echo-core', () => {
9
- return {
10
- __esModule: true,
11
- ...jest.requireActual('@equinor/echo-core'),
12
- storage: {
13
- getItem: jest.fn(),
14
- setItem: jest.fn()
15
- },
16
- EchoEnv: {
17
- env: jest.fn().mockImplementation(() => {
18
- return {
19
- REACT_APP_AZURE_AD_CLIENT_ID: '',
20
- REACT_APP_API_URL: 'non-mono-base-api-url'
21
- };
22
- })
23
- }
24
- };
25
- });
1
+ export {};
2
+ // Should remove this error: BrowserAuthError: crypto_nonexistent: The crypto object or function is not available. Detail:Browser crypto or msCrypto object not available.
3
+ const mGetRandomValues = jest.fn().mockReturnValueOnce(new Uint32Array(10));
4
+ Object.defineProperty(window, 'crypto', {
5
+ value: { getRandomValues: mGetRandomValues }
6
+ });
7
+
8
+ jest.mock('@equinor/echo-core', () => {
9
+ return {
10
+ __esModule: true,
11
+ ...jest.requireActual('@equinor/echo-core'),
12
+ storage: {
13
+ getItem: jest.fn(),
14
+ setItem: jest.fn()
15
+ },
16
+ EchoEnv: {
17
+ env: jest.fn().mockImplementation(() => {
18
+ return {
19
+ REACT_APP_AZURE_AD_CLIENT_ID: '',
20
+ REACT_APP_API_URL: 'non-mono-base-api-url'
21
+ };
22
+ })
23
+ }
24
+ };
25
+ });