From 9e1ae81e43bc3c811c6ea8eec74bdb5a998caf41 Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Wed, 18 Sep 2024 09:15:12 -0400 Subject: [PATCH 1/5] export validation error type --- packages/client/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 0f9dbb1..5f593da 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -37,6 +37,7 @@ export type { TestResultValid, TestResultInvalid, SchemaRecordError, + DictionaryValidationRecordErrorDetails, DictionaryValidationError, FieldValidationError, ParseDictionaryData, From def0a5954c76c568379c927185ac545c273c59b4 Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Thu, 19 Sep 2024 15:22:17 -0400 Subject: [PATCH 2/5] export additional error types --- packages/client/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 5f593da..ce41fb2 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -36,9 +36,11 @@ export type { TestResult, TestResultValid, TestResultInvalid, + SchemaValidationRecordErrorDetails, SchemaRecordError, DictionaryValidationRecordErrorDetails, DictionaryValidationError, + FieldValidationErrorRestrictionInfo, FieldValidationError, ParseDictionaryData, ParseDictionaryFailure, @@ -46,6 +48,7 @@ export type { ParseSchemaError, ParseSchemaFailureData, ParseSchemaResult, + ParseRecordFailureData, ParseRecordResult, } from '@overture-stack/lectern-validation'; From 2e255761037fce8ddd9d71edffb55d9fc71e6309 Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Mon, 23 Sep 2024 09:38:16 -0400 Subject: [PATCH 3/5] run integration tests separately --- apps/server/.mocharc.integration.json | 6 ++++++ apps/server/.mocharc.json | 1 + apps/server/package.json | 3 ++- package.json | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/server/.mocharc.integration.json diff --git a/apps/server/.mocharc.integration.json b/apps/server/.mocharc.integration.json new file mode 100644 index 0000000..909b5a8 --- /dev/null +++ b/apps/server/.mocharc.integration.json @@ -0,0 +1,6 @@ +{ + "extension": ["ts"], + "require": "ts-node/register", + "spec": "test/integration/**/*.spec.ts", + "timeout": 35000 +} diff --git a/apps/server/.mocharc.json b/apps/server/.mocharc.json index 6d2641a..130ab18 100644 --- a/apps/server/.mocharc.json +++ b/apps/server/.mocharc.json @@ -2,5 +2,6 @@ "extension": ["ts"], "require": "ts-node/register", "spec": "test/**/*.spec.ts", + "ignore": ["test/integration/**/*"], "timeout": 35000 } diff --git a/apps/server/package.json b/apps/server/package.json index 50a0e09..8cb2451 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -7,7 +7,8 @@ "build": "tsc -p tsconfig.build.json", "debug": "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec node --inspect -r ts-node/register ./src/server.ts", "start": "NODE_ENV=production ts-node -T src/server.ts", - "test": "nyc mocha" + "test": "nyc mocha", + "integration-test": "nyc mocha --config .mocharc.integration.json" }, "repository": { "type": "git", diff --git a/package.json b/package.json index fadba1d..59c7abd 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build:server": "pnpm nx build @overture-stack/lectern-server", "build:client": "pnpm nx build @overture-stack/lectern-client", "test:all": "pnpm nx run-many --all --target=test", + "integration-test:all": "pnpm nx run-many --all --target=integration-test", "test:dictionary": "pnpm nx test @overture-stack/lectern-dictionary", "test:validation": "pnpm nx test @overture-stack/lectern-validation", "test:server": "pnpm nx test @overture-stack/lectern-server", From 8bb8e96d31174b2f4da7b0ef67f785009fc2e9e6 Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Thu, 26 Sep 2024 15:43:39 -0400 Subject: [PATCH 4/5] rename package scripts --- package.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 59c7abd..0bb5573 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,13 @@ "build:validation": "pnpm nx build @overture-stack/lectern-validation", "build:server": "pnpm nx build @overture-stack/lectern-server", "build:client": "pnpm nx build @overture-stack/lectern-client", - "test:all": "pnpm nx run-many --all --target=test", - "integration-test:all": "pnpm nx run-many --all --target=integration-test", - "test:dictionary": "pnpm nx test @overture-stack/lectern-dictionary", - "test:validation": "pnpm nx test @overture-stack/lectern-validation", - "test:server": "pnpm nx test @overture-stack/lectern-server", - "test:client": "pnpm nx test @overture-stack/lectern-client", + "test:all": "pnpm nx run-many --all --target=test,integration-test", + "test:unit:all": "pnpm nx run-many --all --target=test", + "test:unit:dictionary": "pnpm nx test @overture-stack/lectern-dictionary", + "test:unit:validation": "pnpm nx test @overture-stack/lectern-validation", + "test:unit:server": "pnpm nx test @overture-stack/lectern-server", + "test:unit:client": "pnpm nx test @overture-stack/lectern-client", + "test:integration:server": "pnpm nx integration-test @overture-stack/lectern-server", "generate": "pnpm build:dictionary && pnpm -C scripts generate" }, "keywords": [], From 525c3c9b5c23870c864900cf881f470a2c6ca1aa Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Thu, 26 Sep 2024 15:48:17 -0400 Subject: [PATCH 5/5] rename test:integration script name --- apps/server/package.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/server/package.json b/apps/server/package.json index 8cb2451..b48d50a 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -8,7 +8,7 @@ "debug": "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec node --inspect -r ts-node/register ./src/server.ts", "start": "NODE_ENV=production ts-node -T src/server.ts", "test": "nyc mocha", - "integration-test": "nyc mocha --config .mocharc.integration.json" + "test:integration": "nyc mocha --config .mocharc.integration.json" }, "repository": { "type": "git", diff --git a/package.json b/package.json index 0bb5573..1a6c2cd 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,13 @@ "build:validation": "pnpm nx build @overture-stack/lectern-validation", "build:server": "pnpm nx build @overture-stack/lectern-server", "build:client": "pnpm nx build @overture-stack/lectern-client", - "test:all": "pnpm nx run-many --all --target=test,integration-test", + "test:all": "pnpm nx run-many --all --target=test,test:integration", "test:unit:all": "pnpm nx run-many --all --target=test", "test:unit:dictionary": "pnpm nx test @overture-stack/lectern-dictionary", "test:unit:validation": "pnpm nx test @overture-stack/lectern-validation", "test:unit:server": "pnpm nx test @overture-stack/lectern-server", "test:unit:client": "pnpm nx test @overture-stack/lectern-client", - "test:integration:server": "pnpm nx integration-test @overture-stack/lectern-server", + "test:integration:server": "pnpm nx test:integration @overture-stack/lectern-server", "generate": "pnpm build:dictionary && pnpm -C scripts generate" }, "keywords": [],