Skip to content

Commit

Permalink
test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Jul 5, 2024
1 parent 9a49b7c commit df0ef6a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
8 changes: 4 additions & 4 deletions tests/squaremap/towns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ describe('[Squaremap/Aurora] Towns', () => {
assertType<SquaremapTown[]>(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<SquaremapTown | SquaremapTown[]>(town)

// TODO: Verify there are no duplicates residents.
//@ts-expect-error
assertType<SquaremapTown | SquaremapTown[]>(town)
})

// it('can get towns invitable to specified nation', async () => {
Expand Down
11 changes: 7 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)']
},
}
})

0 comments on commit df0ef6a

Please sign in to comment.