From f7cbc4a3b038f01f3de27bbeafd29700db053f86 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Thu, 23 Jan 2025 15:46:06 +0100 Subject: [PATCH] chore(feo): mock CRD for config tests --- packages/config/.eslintrc | 2 +- packages/config/src/lib/config.test.js | 2 +- packages/config/src/lib/crd-mock.yaml | 32 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 packages/config/src/lib/crd-mock.yaml diff --git a/packages/config/.eslintrc b/packages/config/.eslintrc index 78ee62445..37fdd0772 100644 --- a/packages/config/.eslintrc +++ b/packages/config/.eslintrc @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.js"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "**/*.yaml"], "rules": { "@typescript-eslint/no-var-requires": "off" } diff --git a/packages/config/src/lib/config.test.js b/packages/config/src/lib/config.test.js index a1dac7b76..e1f45476b 100644 --- a/packages/config/src/lib/config.test.js +++ b/packages/config/src/lib/config.test.js @@ -1,6 +1,6 @@ import config from './createConfig'; -const configBuilder = (c) => config({ rootFolder: '', ...c }); +const configBuilder = (c) => config({ rootFolder: '', frontendCRDPath: './crd-mock.yaml', ...c }); describe('should create dummy config with no options', () => { const { mode, optimization, entry, output, devServer } = config({ diff --git a/packages/config/src/lib/crd-mock.yaml b/packages/config/src/lib/crd-mock.yaml new file mode 100644 index 000000000..a86c4f4ca --- /dev/null +++ b/packages/config/src/lib/crd-mock.yaml @@ -0,0 +1,32 @@ + +apiVersion: v1 +kind: Template +metadata: + name: mock-frontend +objects: + - apiVersion: cloud.redhat.com/v1alpha1 + kind: Frontend + metadata: + name: mock-frontend + spec: + API: + versions: + - v1 + envName: ${ENV_NAME} + title: Mock app + deploymentRepo: https://github.com/RedHatInsights/mock + frontend: + paths: + - /apps/mock-app + image: ${IMAGE}:${IMAGE_TAG} + module: + manifestLocation: '/apps/mock/fed-mods.json' + modules: [] + +parameters: + - name: ENV_NAME + required: true + - name: IMAGE_TAG + required: true + - name: IMAGE + value: quay.io/cloudservices/foo