suite-slimmer
v3.2.15
Published
Streamlines JavaScript testing.
Downloads
26
Readme
suite-slimmer
Streamlines JavaScript testing.
Packages
This is mostly intended for either Angular or NestJS projects, using the following packages:
Installation
npm install suite-slimmer --save-dev
Usage
Tests can also be written for non-Angular and non-NestJS projects with this package directly.
Creating a test
Instantiate a test suite, providing the class type being tested.
import { SlimTestSuite } from 'suite-slimmer'
new SlimTestSuite(MyClass)
.addProviders(new MyDependencyA(), new MyDependencyB())
.addTest('should create class', (cls) => {
expect(cls).to.be.truthy
})
.run()
On SlimTestSuite
, the following methods are available and chainable:
- addImports
- addDeclarations
- addProviders
- addMocks
- addTest
- beforeEach
- afterEach
- beforeAll
- afterAll
- run
Frameworks
The following test frameworks are supported:
- Jasmine
- Jest
- Mocha
Examples
See examples here.