Skip to content

Commit aa5273d

Browse files
committed
get tests working, integration and unit are the same though, need to update them
1 parent 9261c01 commit aa5273d

File tree

52 files changed

+767
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+767
-166
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@
6767
"peerDependencies": false
6868
}
6969
],
70-
"no-secrets/no-secrets": ["error", { "additionalRegexes": {}, "ignoreContent": [] }],
70+
"no-secrets/no-secrets": [
71+
"error",
72+
{ "additionalRegexes": {}, "ignoreContent": [] }
73+
],
7174
"no-unused-vars": "off",
7275
"@typescript-eslint/no-unused-vars": [
7376
"warn", // or "error"

jest.setup.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import '@testing-library/jest-dom';
2+
import 'cross-fetch/polyfill';
23

34
jest.mock('@nivo/bar');
45
jest.mock('@nivo/line');
@@ -11,7 +12,11 @@ jest.mock('next/dynamic', () => ({
1112
const dynamicActualComp = dynamicModule.default;
1213
const RequiredComponent = dynamicActualComp(props[0]);
1314
// eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
14-
RequiredComponent.preload ? RequiredComponent.preload() : RequiredComponent.render.preload();
15+
RequiredComponent.preload
16+
? RequiredComponent.preload()
17+
: RequiredComponent.render.preload();
1518
return RequiredComponent;
1619
},
1720
}));
21+
22+
global.fetch = jest.fn();

package-lock.json

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
"test:integration": "jest --config jest.config.js --coverage --coverageDirectory=coverage/integration tests/ui/integration",
1414
"test:e2e": "cypress run --headless",
1515
"coverage:merge": "nyc merge coverage/unit > coverage/tmp.json && nyc merge coverage/integration coverage/tmp.json && mv coverage/tmp.json coverage/coverage-final.json",
16-
"coverage:collect":
17-
"mkdir -p .nyc_output && cp coverage/coverage-final.json .nyc_output/merged.json",
18-
"coverage:report":
19-
"nyc report --reporter=json-summary --reporter=lcov --report-dir=coverage",
20-
"coverage:badge":
21-
"jest-coverage-badges --input coverage/coverage-summary.json --output coverage/.coverage"
16+
"coverage:collect": "mkdir -p .nyc_output && cp coverage/coverage-final.json .nyc_output/merged.json",
17+
"coverage:report": "nyc report --reporter=json-summary --reporter=lcov --report-dir=coverage",
18+
"coverage:badge": "jest-coverage-badges --input coverage/coverage-summary.json --output coverage/.coverage"
2219
},
23-
2420
"dependencies": {
2521
"@emotion/cache": "^11.13.1",
2622
"@emotion/react": "^11.14.0",
@@ -54,6 +50,7 @@
5450
"@types/testing-library__jest-dom": "^5.14.9",
5551
"@typescript-eslint/eslint-plugin": "^8.33.1",
5652
"@typescript-eslint/parser": "^8.33.1",
53+
"cross-fetch": "^4.1.0",
5754
"cypress": "^13.13.3",
5855
"eslint": "^9.0.0",
5956
"eslint-config-next": "15.3.2",

src/ui/.env.development

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ASSET_PREFIX=https://review.neuralmagic.com/guidellm-ui/dev/_next
2+
BASE_PATH=/guidellm-ui/dev
3+
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ASSET_PREFIX=http://localhost:3000
2+
BASE_PATH=http://localhost:3000
3+
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.local

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ASSET_PREFIX=http://localhost:3000
2+
BASE_PATH=http://localhost:3000
3+
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.production

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ASSET_PREFIX=https://review.neuralmagic.com/guidellm-ui/dev/_next
2+
BASE_PATH=/guidellm-ui/dev
3+
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/.env.staging

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ASSET_PREFIX=https://staging.guidellm.neuralmagic.com
2+
BASE_PATH=/guidellm-ui/staging
3+
NEXT_PUBLIC_USE_MOCK_API=true

src/ui/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
5050
__html: benchmarksScript,
5151
}}
5252
/>
53-
</head>
53+
</head>
5454
<body>{children}</body>
5555
</html>
5656
);

0 commit comments

Comments
 (0)