mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Add frontend tests to pre-commit and Makefile. (#1549)
Signed-off-by: ifuryst <ifuryst@gmail.com>
This commit is contained in:
parent
bccb8297b8
commit
6013faeec5
7
Makefile
7
Makefile
@ -160,6 +160,13 @@ lint:
|
||||
@$(MAKE) -s lint-frontend
|
||||
@$(MAKE) -s lint-backend
|
||||
|
||||
test-frontend:
|
||||
@echo "$(YELLOW)Running tests for frontend...$(RESET)"
|
||||
@cd frontend && npm run test
|
||||
|
||||
test:
|
||||
@$(MAKE) -s test-frontend
|
||||
|
||||
build-frontend:
|
||||
@echo "$(YELLOW)Building frontend...$(RESET)"
|
||||
@cd frontend && npm run build
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd frontend
|
||||
npx lint-staged
|
||||
npm run test
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"test": "vitest",
|
||||
"test": "vitest run",
|
||||
"preview": "vite preview",
|
||||
"make-i18n": "node scripts/make-i18n-translations.cjs",
|
||||
"prelint": "npm run make-i18n",
|
||||
@ -48,7 +48,7 @@
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
"pre-commit": "npm run test && lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
@ -190,7 +190,7 @@ describe("SettingsModal", () => {
|
||||
userEvent.click(saveButton);
|
||||
});
|
||||
|
||||
expect(toastSpy).toHaveBeenCalledTimes(1);
|
||||
expect(toastSpy).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it("should change the language", async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user