mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add package for sharing jest configuration for upcoming Features (#7198)
* Add package for shared jest configurations for Lens applications, Features and libraries. Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add root level script for running unit tests in monorepo mindset Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Ignore coverage files from VCS Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> --------- Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
114db72485
commit
73230c8659
11 files changed
+1902
-154
No files matched your search
@@ -0,0 +1,55 @@
|
||||
# @k8slens/jest
|
||||
|
||||
This package contains jest configurations and scripts for Lens packages.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install @k8slens/jest
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Package configurations
|
||||
Shared configurations for minimal duplication.
|
||||
|
||||
#### Node
|
||||
|
||||
**./packages/<any-package>/jest.config.js**
|
||||
```javascript
|
||||
module.exports = require("@k8slens/jest").monorepoPackageConfig(__dirname).configForNode;
|
||||
```
|
||||
|
||||
#### React
|
||||
|
||||
**./packages/<any-package>/jest.config.js**
|
||||
```javascript
|
||||
module.exports = require("@k8slens/jest").monorepoPackageConfig(__dirname).configForReact;
|
||||
```
|
||||
|
||||
### Root configuration
|
||||
You may want to enable testing of packages using single command from root level. This allows you to utilize `jest --watch` between all packages.
|
||||
|
||||
|
||||
**./jest.config.js**
|
||||
```javascript
|
||||
module.exports = require("@k8slens/jest").monorepoRootConfig(__dirname);
|
||||
```
|
||||
|
||||
### Scripts
|
||||
|
||||
#### lens-test
|
||||
Test package with coverage enforcement. Automatically opens coverage report in case of failure.
|
||||
|
||||
**./packages/<any-package>/package.json**
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"test": "lens-test"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user