Skip to content

Add integration tests using vitest #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 9, 2025
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
34 changes: 0 additions & 34 deletions .github/workflows/push.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

name: Test

on:
push:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build:

runs-on: ${{ matrix.operating-system }}

strategy:
fail-fast: false
matrix:
operating-system:
- ubuntu-latest
# logtalk-actions/setup-swi-prolog@master does not work with windows, so a different solution would be required
# - windows-latest
node-version:
- 20.x
- 22.x
- 24.x

steps:

- name: Install prolog
uses: logtalk-actions/setup-swi-prolog@master

- name: Clone EYE repo
uses: actions/checkout@v4
with:
repository: eyereasoner/eye

- name: Build EYE
run: bash install.sh --prefix=$HOME/.local # This folder is available on $PATH already

- name: Checkout main branch
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Enable Node.js Corepack
run: corepack enable

- name: Yarn install
run: yarn install

- name: Test
run: yarn test
11 changes: 0 additions & 11 deletions demo/flow-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ import { Parser, Writer, Store } from 'n3';
import { randomUUID } from 'crypto';
import chalk from 'chalk'

// import * as jsonld from 'jsonld';

// import vc from '@digitalcredentials/vc';

// // Required to set up a suite instance with private key
// import {Ed25519VerificationKey2020} from
// '@digitalcredentials/ed25519-verification-key-2020';
// import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';



const parser = new Parser();
const writer = new Writer();

Expand Down
9 changes: 0 additions & 9 deletions demo/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { Parser, Writer, Store } from 'n3';
import { randomUUID } from 'crypto';
import chalk from 'chalk'

import * as jsonld from 'jsonld';

import vc from '@digitalcredentials/vc';

// Required to set up a suite instance with private key
import {Ed25519VerificationKey2020} from
'@digitalcredentials/ed25519-verification-key-2020';
import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';



const parser = new Parser();
Expand Down
18 changes: 18 additions & 0 deletions demo/seed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"email": "[email protected]",
"password": "abc123",
"pods": [{
"name": "ruben"
}]
},
{
"email": "[email protected]",
"password": "abc123",
"pods": [
{
"name": "demo"
}
]
}
]
49 changes: 14 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],
"private": true,
"packageManager": "yarn@4.1.0",
"packageManager": "yarn@4.9.2",
"engines": {
"node": ">=20.0",
"yarn": ">=4.0"
Expand All @@ -54,52 +54,45 @@
"postinstall": "yarn run sync:list && yarn build",
"clean": "shx rm -rf ./**/node_modules",
"build": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited -t run build",
"test": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run test",
"test": "vitest run",
"start": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run start",
"start:odrl": "yarn workspace @solidlab/uma run start:odrl & yarn workspace @solidlab/uma-css run start",
"start:demo": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run demo",
"script:demo": "yarn exec tsx ./demo/flow.ts",
"script:demo-test": "yarn exec tsx ./demo/flow-test.ts",
"script:public": "yarn exec ts-node ./scripts/test-public.ts",
"script:private": "yarn exec ts-node ./scripts/test-private.ts",
"script:registration": "yarn exec ts-node ./scripts/test-registration.ts",
"script:uma-ucp": "yarn exec ts-node ./scripts/test-uma-ucp.ts",
"script:uma-odrl": "yarn exec ts-node ./scripts/test-uma-ODRL.ts",
"script:public": "yarn exec tsx ./scripts/test-public.ts",
"script:private": "yarn exec tsx ./scripts/test-private.ts",
"script:registration": "yarn exec tsx ./scripts/test-registration.ts",
"script:uma-ucp": "yarn exec tsx ./scripts/test-uma-ucp.ts",
"script:uma-odrl": "yarn exec tsx ./scripts/test-uma-ODRL.ts",
"script:flow": "yarn run script:public && yarn run script:private && yarn run script:uma-ucp && yarn run script:registration",
"sync:list": "syncpack list-mismatches",
"sync:fix": "syncpack fix-mismatches"
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@solidlab/ucp": "workspace:^",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"@types/node": "^20.19.1",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"chalk": "^5.4.1",
"componentsjs-generator": "^3.1.2",
"concurrently": "^8.2.2",
"eslint": "^8.10.0",
"jest": "^29.7.0",
"jest-rdf": "^1.8.1",
"koreografeye": "^0.4.8",
"shx": "^0.3.4",
"syncpack": "^13.0.2",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"tsx": "^4.19.2",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vitest": "^3.2.3"
},
"resolutions": {
"@types/node": "^20.11.25"
"@types/node": "^20.19.1"
},
"workspaces": [
"packages/*"
],
"jest": {
"projects": [
"./packages/*/package.json"
]
},
"eslintConfig": {
"env": {
"browser": true,
Expand Down Expand Up @@ -154,19 +147,5 @@
]
]
}
},
"dependencies": {
"@digitalbazaar/ed25519-signature-2020": "^5.4.0",
"@digitalbazaar/ed25519-verification-key-2020": "^4.2.0",
"@digitalbazaar/vc": "^7.1.0",
"@digitalcredentials/ed25519-signature-2020": "^6.0.0",
"@digitalcredentials/ed25519-verification-key-2020": "^4.0.0",
"@digitalcredentials/vc": "^9.0.1",
"@digitalcredentials/vc-data-model": "^2.0.0",
"@inrupt/solid-client": "^2.0.1",
"@inrupt/solid-client-authn-core": "^2.1.0",
"chalk": "^5.4.1",
"jsonld": "^8.3.3",
"tsx": "^4.19.2"
}
}
2 changes: 1 addition & 1 deletion packages/css/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"css:config/storage/key-value/resource-store.json",
"css:config/storage/location/pod.json",
"css:config/storage/middleware/default.json",
"css:config/util/auxiliary/acl.json",
"css:config/util/auxiliary/empty.json",
"css:config/util/identifiers/suffix.json",
"css:config/util/index/default.json",
"css:config/util/logging/winston.json",
Expand Down
1 change: 0 additions & 1 deletion packages/css/config/demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
],
"import": [
"uma-css:config/default.json",
"uma-css:config/derived.json",
"css:config/storage/backend/data-accessors/file.json"
],
"@graph": [
Expand Down
72 changes: 0 additions & 72 deletions packages/css/config/derived.json

This file was deleted.

40 changes: 17 additions & 23 deletions packages/css/config/ldp/authorization/readers/uma.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,24 @@
"requestedModes"
],
"source": {
"comment": "Requests permissions on subject resources for auxiliary resources.",
"@type": "AuxiliaryReader",
"auxiliaryStrategy": {
"@id": "urn:solid-server:default:AuxiliaryStrategy"
},
"reader": {
"@type": "UnionPermissionReader",
"readers": [
{
"comment": "This PermissionReader will be used to prevent external access to containers used for internal storage.",
"@id": "urn:solid-server:default:PathBasedReader",
"@type": "PathBasedReader",
"baseUrl": {
"@id": "urn:solid-server:default:variable:baseUrl"
}
},
{
"comment": "The main reader, checks permissions from UMA token.",
"@id": "urn:solid-server:default:UmaPermissionReader",
"@type": "UmaPermissionReader"
"@id": "urn:uma:default:UnionPermissionReader",
"@type": "UnionPermissionReader",
"readers": [
{
"comment": "This PermissionReader will be used to prevent external access to containers used for internal storage.",
"@id": "urn:solid-server:default:PathBasedReader",
"@type": "PathBasedReader",
"baseUrl": {
"@id": "urn:solid-server:default:variable:baseUrl"
}
]
}
},
{
"comment": "The main reader, checks permissions from UMA token.",
"@id": "urn:solid-server:default:UmaPermissionReader",
"@type": "UmaPermissionReader"
}
]
}
}
]
}
}
Loading