Skip to content

Commit

Permalink
chore(feo): mock CRD for config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Jan 23, 2025
1 parent 6dd5733 commit f7cbc4a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/config/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "**/*.yaml"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/lib/config.test.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
32 changes: 32 additions & 0 deletions packages/config/src/lib/crd-mock.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f7cbc4a

Please sign in to comment.