@adaliszk/typescript-testing
v5.4.4
Published
Meta-Package for testing Typescript Testing with Vitest
Downloads
38
Maintainers
Readme
Meta-Package for testing Typescript with Vitest
Provides
@testdeck/vitest
vitest
chai
Usage
- Install the package
pnpm install -D @adaliszk/typescript-testing vitest
- Add a vitest config:
import { defineConfig } from '@adaliszk/typescript-testing' export default defineConfig({ test: { // ... }, })
- Add a script to run the tests and collect the coverage:
"scripts": { "test": "vitest", "test:ui": "vitest --ui", "coverage": "vitest run --coverage" }
Furthermore, this package is a facade for the provided packages where each export is available on the default output, or
you can use them as namespace like testdeck
and chai
.
For example, what normally looks like:
describe('MyModule', () =>
{
it('should be able to import', () =>
{
import() /* ... */
})
})
Can be written with testdeck:
import { describe, it } from '@adaliszk/typescript-testing'
@describe
class MyModule
{
@it
'should be able to import' ()
{
import() /* ... */
}
}
Versioning
Since this is a meta-package, the versioning reflect its main provided package, in this case typescript
. However, only the
Major and Minor versions are kept in sync. The Patch is used to bump the meta-package.