Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Changed @spree/core typecheck to cover its tests and scripts (#14942)

Damian Legawiec81007418cac1
diff --git a/packages/core/package.json b/packages/core/package.json
index 0dff248c34..f89489bba0 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -29,7 +29,7 @@
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run",
- "typecheck": "tsc --noEmit",
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.tests.json",
"lint": "biome check src tests",
"lint:fix": "biome check --fix src tests",
"format": "biome format --write src tests",
diff --git a/packages/core/tests/unit-systems.test.ts b/packages/core/tests/unit-systems.test.ts
index 25ffb3587b..4cb70e8634 100644
--- a/packages/core/tests/unit-systems.test.ts
+++ b/packages/core/tests/unit-systems.test.ts
@@ -21,12 +21,13 @@ function publishedUnitSystems(node: unknown, found = new Set<string>()): Set<str
}
describe('unit systems', () => {
+ // Parsing the multi-megabyte reference outlasts the default five seconds on CI runners.
it('match the unit systems the Admin API accepts', () => {
const reference = parse(
readFileSync(resolve(__dirname, '../../../docs/api-reference/admin.yaml'), 'utf-8'),
)
expect([...publishedUnitSystems(reference)].sort()).toEqual([...UNIT_SYSTEMS].sort())
- })
+ }, 30_000)
it('offer every weight unit in exactly one system', () => {
expect(Object.values(UNIT_SYSTEM_WEIGHT_UNITS).flat().sort()).toEqual(
diff --git a/packages/core/tsconfig.tests.json b/packages/core/tsconfig.tests.json
new file mode 100644
index 0000000000..3919d120e9
--- /dev/null
+++ b/packages/core/tsconfig.tests.json
@@ -0,0 +1,8 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "noEmit": true,
+ "rootDir": "."
+ },
+ "include": ["src/**/*", "tests/**/*", "scripts/**/*", "*.config.ts"]
+}