From df0ef6acfec40191c99c20895e9c1dcaa37d7197 Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 5 Jul 2024 12:32:08 +0100 Subject: [PATCH] test stuff --- package.json | 3 ++- tests/squaremap/towns.test.ts | 8 ++++---- vitest.config.ts | 11 +++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 01fcdae..e7cdc4e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "clean": "rimraf dist", "build": "bun run clean && rollup -c && tsc --declaration true --emitDeclarationOnly true --declarationMap", "docs": "typedoc --options typedoc.json", - "test": "vitest run --pool=forks --config ./vitest.config.ts", + "test": "vitest run --config ./vitest.config.ts", + "typecheck": "vitest --typecheck --typecheck.only", "test-browser": "vitest run --browser.name=chrome --browser.headless --config ./vitest.config.ts" }, "files": [ diff --git a/tests/squaremap/towns.test.ts b/tests/squaremap/towns.test.ts index f0050bf..4d6538b 100644 --- a/tests/squaremap/towns.test.ts +++ b/tests/squaremap/towns.test.ts @@ -13,14 +13,14 @@ describe('[Squaremap/Aurora] Towns', () => { assertType(towns) }) + // TODO: Verify there are no duplicates residents. it('can get single town', async () => { - const town = await Aurora.Towns.get('sakya') as SquaremapTown - + const town = await Aurora.Towns.get('venice') expect(town).toBeTruthy() expect(town).toBeDefined() - assertType(town) - // TODO: Verify there are no duplicates residents. + //@ts-expect-error + assertType(town) }) // it('can get towns invitable to specified nation', async () => { diff --git a/vitest.config.ts b/vitest.config.ts index 8fa9551..ff97680 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,13 +8,16 @@ export default defineConfig({ globals: true, watch: false, reporters: 'verbose', - pool: 'vmForks', + pool: 'forks', poolOptions: { - vmForks: { - memoryLimit: 0.15, // 15% of sys mem + forks: { + //memoryLimit: 0.15, // 15% of sys mem minForks: 2, // always use 2 threads maxForks: 6 // 6 threads is enough } - } + }, + typecheck: { + include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'] + }, } }) \ No newline at end of file