Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/test-apiscoringviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test API Scoring Viewer

permissions:
contents: read
actions: write

on:
pull_request:
paths:
- "plugins/spa-apiscoringviewer/**"
- ".github/workflows/test-apiscoringviewer.yml"
jobs:
test:
name: Run Vitest Tests on SPA
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8.15.9

- name: Install dependencies
run: |
cd plugins/spa-apiscoringviewer
pnpm install --frozen-lockfile --recursive

- name: Run tests
run: |
cd plugins/spa-apiscoringviewer/packages/apiscoringviewer
pnpm test -- --run

- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: plugins/spa-apiscoringviewer/packages/apiscoringviewer/coverage/
if-no-files-found: ignore
9 changes: 4 additions & 5 deletions plugins/spa-apiscoringviewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,28 @@ This folder contains the **SPA** of the API Scoring extension. The structure is
```
npm install --global pnpm
pnpm install
```
```

4. Once the process finishes, start the SPA:

```
pnpm start
```

5. Configure the VSCode plugin (for local development):
5. Configure the VSCode plugin (for local development):

If you are running the SPA locally, open VSCode with the plugin already installed. Then, in the plugin settings, go to (Api Scoring › Certification › Frontend: Url) and set the frontend URL to:

```
http://localhost:3000
```



> #### TIP
>
> If you need to remove all dependencies, you can use the following command:
>
> ```
> pnpm clean
> pnpm clear
> ```

<br>
Expand Down
9 changes: 0 additions & 9 deletions plugins/spa-apiscoringviewer/jest-setup.ts

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/spa-apiscoringviewer/jest.config.js

This file was deleted.

5 changes: 1 addition & 4 deletions plugins/spa-apiscoringviewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"prerelease": "preconstruct build",
"postinstall": "preconstruct dev",
"start": "pnpm --filter=spa-apiscoringviewer watch",
"test": "jest --config=jest.config.js",
"prettier": "prettier --write \"**/*.{css,html,js,json,jsx,ts,tsx}\"",
"prettier:ci": "prettier --check \"**/*.{css,html,js,json,jsx,ts,tsx}\"",
"typescript": "tsc --noEmit",
Expand All @@ -26,15 +25,14 @@
"@babel/preset-typescript": "^7.25.7",
"@testing-library/jest-dom": "^6.5.0",
"@types/jest": "^29.5.13",
"@types/node": "^18.19.55",
"@types/node": "^22.15.3",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/testing-library__jest-dom": "^5.14.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/type-utils": "^6.21.0",
"eslint": "^8.57.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"parcel": "latest",
"prettier": "latest",
Expand All @@ -43,7 +41,6 @@
"typescript": "^5.6.3"
},
"dependencies": {
"@jest/globals": "^29.7.0",
"@parcel/config-default": "^2.9.3",
"@parcel/core": "^2.9.3",
"@parcel/packager-ts": "^2.9.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@inditextech/apiscoringviewer",
"description": "React components for API Scoring Viewer",
"version": "1.0.4",
"version": "1.1.0",
"license": "Apache-2.0",
"author": {
"name": "Inditex Open Source Team",
Expand Down Expand Up @@ -78,23 +78,28 @@
"clear:node_modules": "rm -rf ./node_modules",
"build": "parcel build",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"test": "vitest",
"watch": "parcel watch --port=2345"
},
"devDependencies": {
"@babel/core": "^7.12.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.3.0",
"@types/lodash": "^4.14.195",
"@types/react-router-dom": "^5.3.3",
"cpx": "^1.5.0",
"eslint": "^8.37.0",
"eslint-plugin-no-restricted-imports": "^0.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^26.1.0",
"react": "^18",
"react-dom": "^18",
"type-fest": "^3.12.0"
"type-fest": "^3.12.0",
"vitest": "^3.2.4"
},
"peerDependencies": {
"react": "^16.14.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"browserslist": [
"Chrome 79"
Expand All @@ -107,7 +112,6 @@
"@parcel/optimizer-htmlnano": "^2.9.3",
"@sindresorhus/slugify": "^2.2.1",
"@tabler/icons-react": "^2.23.0",
"@testing-library/jest-dom": "^5.16.5",
"lodash": "^4.17.21",
"react-error-boundary": "^4.0.10",
"react-intl": "^6.4.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

import { test, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import ApiTabs from "../components/api-tabs";
import { CERTS_PAYLOAD, Providers } from "../../utils/test-utils";
Expand Down
Loading
Loading