1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

General changes

- Remove scripts/test.sh and move functionality into `Makefile`

- improve rebuilting ability of Makefile with better dependencies

- change default jest env to jsdom, remove all file headers except for
  integration test file which should be run with jest env node

- Remove package.json test script as `make test` covers that

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-01-28 10:35:38 -05:00
parent e69f07d1af
commit 6452426fb0
8 changed files with 18 additions and 25 deletions

View File

@ -1,3 +1,8 @@
CMD_ARGS = $(filter-out $@,$(MAKECMDGOALS))
%:
@:
EXTENSIONS_DIR = ./extensions
extensions = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir})
extension_node_modules = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/node_modules)
@ -9,6 +14,7 @@ else
DETECTED_OS := $(shell uname)
endif
.PHONY: binaries/client
binaries/client: node_modules
yarn download-bins
@ -34,7 +40,7 @@ lint:
.PHONY: test
test: binaries/client
yarn test
yarn run jest $(or $(CMD_ARGS), "src")
.PHONY: integration-linux
integration-linux: binaries/client build-extension-types build-extensions
@ -58,10 +64,6 @@ integration-win: binaries/client build-extension-types build-extensions
yarn build:win
yarn integration
.PHONY: test-app
test-app:
yarn test
.PHONY: build
build: node_modules binaries/client build-extensions
ifeq "$(DETECTED_OS)" "Windows"

View File

@ -1,3 +1,13 @@
/**
* @jest-environment node
*/
/*
Cluster tests are run if there is a pre-existing minikube cluster. Before running cluster tests the TEST_NAMESPACE
namespace is removed, if it exists, from the minikube cluster. Resources are created as part of the cluster tests in the
TEST_NAMESPACE namespace. This is done to minimize destructive impact of the cluster tests on an existing minikube
cluster and vice versa.
*/
import { Application } from "spectron";
import * as utils from "../helpers/utils";
import { listHelmRepositories } from "../helpers/utils";

View File

@ -25,7 +25,6 @@
"build:linux": "yarn run compile && electron-builder --linux --dir -c.productName=Lens",
"build:mac": "yarn run compile && electron-builder --mac --dir -c.productName=Lens",
"build:win": "yarn run compile && electron-builder --win --dir -c.productName=Lens",
"test": "scripts/test.sh",
"integration": "jest --runInBand integration",
"dist": "yarn run compile && electron-builder --publish onTag",
"dist:win": "yarn run compile && electron-builder --publish onTag --x64 --ia32",
@ -35,7 +34,7 @@
"download:kubectl": "yarn run ts-node build/download_kubectl.ts",
"download:helm": "yarn run ts-node build/download_helm.ts",
"build:tray-icons": "yarn run ts-node build/build_tray_icon.ts",
"lint": "yarn run eslint $@ --ext js,ts,tsx --max-warnings=0 .",
"lint": "yarn run eslint --ext js,ts,tsx --max-warnings=0 .",
"lint:fix": "yarn run lint --fix",
"mkdocs-serve-local": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest",
"verify-docs": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict",
@ -51,7 +50,6 @@
"jest": {
"collectCoverage": false,
"verbose": true,
"testEnvironment": "node",
"transform": {
"^.+\\.tsx?$": "ts-jest"
},

View File

@ -1 +0,0 @@
jest --env=jsdom ${1:-src}

View File

@ -1,7 +1,3 @@
/**
* @jest-environment jsdom
*/
import { SearchStore } from "../search-store";
let searchStore: SearchStore = null;

View File

@ -1,7 +1,3 @@
/**
* @jest-environment jsdom
*/
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import { fireEvent, render } from "@testing-library/react";

View File

@ -1,7 +1,3 @@
/**
* @jest-environment jsdom
*/
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import { render } from "@testing-library/react";

View File

@ -1,7 +1,3 @@
/**
* @jest-environment jsdom
*/
import { podsStore } from "../../+workloads-pods/pods.store";
import { Pod } from "../../../api/endpoints";
import { dockStore } from "../dock.store";