From eb67d90308c65d2cecca22b9bbbf9e46cfe06e29 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 10 Mar 2023 16:44:55 -0800 Subject: [PATCH 1/9] feat: add loading event config --- .eslintrc.json | 5 ++++- src/index.js | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ed65eed..fe00fd4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": ["@adobe/eslint-config-aio-lib-config"] + "extends": ["@adobe/eslint-config-aio-lib-config"], + "parserOptions": { + "ecmaVersion": 2020 + } } \ No newline at end of file diff --git a/src/index.js b/src/index.js index 678506b..e59b01f 100644 --- a/src/index.js +++ b/src/index.js @@ -158,7 +158,7 @@ function loadCommonConfig () { ow: owConfig, aio: aioConfig, // soon not needed anymore (for old headless validator) - imsOrgId: aioConfig && aioConfig.project && aioConfig.project.org && aioConfig.project.org.ims_org_id + imsOrgId: aioConfig.project?.org?.ims_org_id } } @@ -289,7 +289,9 @@ function loadUserConfigLegacy (commonConfig) { // todo: new value usingLegacyConfig // this module should not console.log/warn ... or include chalk ... if (commonConfig.aio.cna !== undefined || commonConfig.aio.app !== undefined) { - aioLogger.warn('App config in \'.aio\' file is deprecated. Please move your \'.aio.app\' or \'.aio.cna\' to \'app.config.yaml\'.') + // this might have never have been seen in the wild as we don't know + // what log-level users have set + aioLogger.error('App config in \'.aio\' file is deprecated. Please move your \'.aio.app\' or \'.aio.cna\' to \'app.config.yaml\'.') const appConfig = { ...commonConfig.aio.app, ...commonConfig.aio.cna } Object.entries(appConfig).forEach(([k, v]) => { legacyAppConfig[k] = v @@ -344,7 +346,7 @@ function loadUserConfigLegacy (commonConfig) { }) // todo: new val usingLegacyHooks:Boolean if (Object.keys(hooks).length > 0) { - aioLogger.warn('hooks in \'package.json\' are deprecated. Please move your hooks to \'app.config.yaml\' under the \'hooks\' key') + aioLogger.error('hooks in \'package.json\' are deprecated. Please move your hooks to \'app.config.yaml\' under the \'hooks\' key') legacyAppConfig.hooks = hooks // build index includeIndex[`${defaults.APPLICATION_CONFIG_KEY}.hooks`] = { file: 'package.json', key: 'scripts' } @@ -421,7 +423,10 @@ function buildExtConfigs (userConfig, commonConfig, includeIndex) { /** @private */ function buildAppConfig (userConfig, commonConfig, includeIndex) { - const fullAppConfig = buildSingleConfig(defaults.APPLICATION_CONFIG_KEY, userConfig[defaults.APPLICATION_CONFIG_KEY], commonConfig, includeIndex) + const fullAppConfig = buildSingleConfig(defaults.APPLICATION_CONFIG_KEY, + userConfig[defaults.APPLICATION_CONFIG_KEY], + commonConfig, + includeIndex) if (!fullAppConfig.app.hasBackend && !fullAppConfig.app.hasFrontend) { // only set application config if there is an actuall app, meaning either some backend or frontend @@ -445,6 +450,7 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI manifest: {}, actions: {}, tests: {}, + events: {}, // root of the app folder root: process.cwd(), name: configName @@ -481,6 +487,8 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI config.app.hasFrontend = fs.existsSync(web) config.app.dist = path.resolve(dist, dist === defaultDistPath ? subFolderName : '') + config.events = singleUserConfig.events + // actions config.actions.src = path.resolve(actions) // needed for app add first action if (config.app.hasBackend) { From 8f7332fc7682175e7942228b9e63a45f39263e4b Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Wed, 29 Mar 2023 16:47:30 -0700 Subject: [PATCH 2/9] add project to loaded config --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 19b2db3..6352cb2 100644 --- a/src/index.js +++ b/src/index.js @@ -451,6 +451,7 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI actions: {}, tests: {}, events: {}, + project: {}, // root of the app folder root: process.cwd(), name: configName @@ -494,7 +495,12 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI config.app.hasFrontend = fs.existsSync(web) config.app.dist = path.resolve(dist, dist === defaultDistPath ? subFolderName : '') - config.events = singleUserConfig.events + if (singleUserConfig.events) { + config.events = singleUserConfig.events + } + if (commonConfig?.aio?.project) { + config.project = commonConfig.aio.project + } // actions config.actions.src = path.resolve(actions) // needed for app add first action From 88082009f8aad3c1853ed73dd6fbe22dab01d42e Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 14 Apr 2023 16:51:48 -0700 Subject: [PATCH 3/9] stub added events + project --- src/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 6352cb2..749a15e 100644 --- a/src/index.js +++ b/src/index.js @@ -450,8 +450,6 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI manifest: {}, actions: {}, tests: {}, - events: {}, - project: {}, // root of the app folder root: process.cwd(), name: configName @@ -495,9 +493,9 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI config.app.hasFrontend = fs.existsSync(web) config.app.dist = path.resolve(dist, dist === defaultDistPath ? subFolderName : '') - if (singleUserConfig.events) { - config.events = singleUserConfig.events - } + // if (singleUserConfig.events) { + // config.events = { ...singleUserConfig.events } + // } if (commonConfig?.aio?.project) { config.project = commonConfig.aio.project } From c33f414f686e2f1cf395495bca27bc9e7dfff164 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 14 Apr 2023 16:53:19 -0700 Subject: [PATCH 4/9] stubbed events{}, tests passing for project{} --- test/data-mocks/config-loader.js | 18 +++++++++++++++ test/index.test.js | 39 +++++++++++++++++++++++++++----- test/jest.setup.js | 14 ++++++++---- 3 files changed, 61 insertions(+), 10 deletions(-) diff --git a/test/data-mocks/config-loader.js b/test/data-mocks/config-loader.js index 3331653..9068b60 100644 --- a/test/data-mocks/config-loader.js +++ b/test/data-mocks/config-loader.js @@ -215,6 +215,7 @@ const nuiSingleConfig = { e2e: winCompat(`${root}/src/dx-asset-compute-worker-1/e2e`), unit: winCompat(`${root}/src/dx-asset-compute-worker-1/test`) }, + // events: {}, root: `${root}`, name: 'dx/asset-compute/worker/1', hooks: { @@ -269,6 +270,7 @@ const applicationSingleConfig = { e2e: winCompat(`${root}e2e`), unit: winCompat(`${root}test`) }, + // events: {}, root: `${root}`, name: 'application', hooks: { @@ -322,12 +324,16 @@ const applicationNoActionsSingleConfig = { }, root: `${root}`, name: 'application', + // events: {}, hooks: { 'pre-app-run': 'echo hello' } } } +// const applicationNoEventsSingleConfig = { ...applicationNoActionsSingleConfig } +// applicationNoEventsSingleConfig.application.events = {} + // expected return values from config loader for matching fixtures in __fixtures__ const expectedConfigs = { exc: { @@ -368,6 +374,18 @@ const expectedConfigs = { }, root }, + // 'app-no-events': { + // all: { ...applicationNoActionsSingleConfig }, + // implements: [ + // 'application' + // ], + // includeIndex: appNoActionsIncludeIndex, + // packagejson: { + // version: '1.0.0', + // name: 'app-no-actions' + // }, + // root + // }, 'app-no-actions': { all: { ...applicationNoActionsSingleConfig }, implements: [ diff --git a/test/index.test.js b/test/index.test.js index e52e32f..0659b41 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -36,7 +36,11 @@ describe('load config', () => { test('standalone app config', async () => { global.loadFixtureApp('app') config = loadConfig() // {} or not for coverage - expect(config).toEqual(getMockConfig('app', global.fakeConfig.tvm)) + console.log('config = ', JSON.stringify(config, 0, 2)) + const mockConfig = getMockConfig('app', global.fakeConfig.tvm, { + 'all.application.project': expect.any(Object) + }) + expect(config).toEqual(mockConfig) }) test('not in an app', async () => { @@ -47,25 +51,35 @@ describe('load config', () => { test('exc extension config', async () => { global.loadFixtureApp('exc') config = loadConfig({}) - expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm)) + expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm, { + 'all.dx/excshell/1': expect.any(Object) + })) }) test('standalone app, exc and nui extension config', async () => { global.loadFixtureApp('app-exc-nui') config = loadConfig({}) - expect(config).toEqual(getMockConfig('app-exc-nui', global.fakeConfig.tvm)) + expect(config).toEqual(getMockConfig('app-exc-nui', global.fakeConfig.tvm, { + 'all.application.project': expect.any(Object), + 'all.dx/excshell/1.project': expect.any(Object), + 'all.dx/asset-compute/worker/1.project': expect.any(Object) + })) }) test('standalone app with no actions', async () => { global.loadFixtureApp('app-no-actions') config = loadConfig({}) - expect(config).toEqual(getMockConfig('app-no-actions', global.fakeConfig.tvm)) + expect(config).toEqual(getMockConfig('app-no-actions', global.fakeConfig.tvm, { + 'all.application.project': expect.any(Object) + })) }) test('exc with complex include pattern', async () => { global.loadFixtureApp('exc-complex-includes') config = loadConfig({}) - expect(config).toEqual(getMockConfig('exc-complex-includes', global.fakeConfig.tvm)) + expect(config).toEqual(getMockConfig('exc-complex-includes', global.fakeConfig.tvm, { + 'all.dx/excshell/1.project': expect.any(Object) + })) }) test('standalone application with legacy configuration system', async () => { @@ -74,7 +88,9 @@ describe('load config', () => { // mock app config mockAIOConfig.get.mockImplementation(k => fullAioConfig) config = loadConfig({}) - expect(config).toEqual(getMockConfig('legacy-app', fullAioConfig)) + expect(config).toEqual(getMockConfig('legacy-app', fullAioConfig, { + 'all.application.project': expect.any(Object) + })) }) // corner cases - coverage @@ -87,6 +103,7 @@ describe('load config', () => { 'all.dx/excshell/1.app.name': 'unnamed-app', 'all.dx/excshell/1.app.version': '0.1.0', 'all.dx/excshell/1.ow.package': 'unnamed-app-0.1.0', + 'all.dx/excshell/1.project': expect.any(Object), 'packagejson.name': 'unnamed-app', 'packagejson.version': '0.1.0' })) @@ -105,6 +122,7 @@ describe('load config', () => { 'all.dx/excshell/1.actions.dist': path.resolve('/src/dx-excshell-1/new/dist/for/excshell/actions'), 'all.dx/excshell/1.web.distDev': path.resolve('/src/dx-excshell-1/new/dist/for/excshell/web-dev'), 'all.dx/excshell/1.web.distProd': path.resolve('/src/dx-excshell-1/new/dist/for/excshell/web-prod'), + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -125,6 +143,7 @@ describe('load config', () => { secretAccessKey: 'fakesecret', params: { Bucket: 'fakebucket' } }, + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -139,6 +158,7 @@ describe('load config', () => { config = loadConfig({}) expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm, { 'all.dx/excshell/1.s3.tvmUrl': 'customurl', + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -152,6 +172,7 @@ describe('load config', () => { config = loadConfig({}) expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm, { + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -166,6 +187,7 @@ describe('load config', () => { config = loadConfig({}) expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm, { 'all.dx/excshell/1.manifest.full.packages.my-exc-package.actions.newAction': { web: 'yes' }, + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -178,6 +200,7 @@ describe('load config', () => { expect(config).toEqual(getMockConfig('exc', global.fakeConfig.tvm, { 'all.dx/excshell/1.app.defaultHostname': 'dev.runtime.adobe.io', 'all.dx/excshell/1.app.hostname': 'dev.runtime.adobe.io', + 'all.dx/excshell/1.project': expect.any(Object), includeIndex: expect.any(Object) })) }) @@ -280,6 +303,8 @@ extensions: config = loadConfig({}) expect(config).toEqual(getMockConfig('legacy-app', fullAioConfig, { 'all.application.hooks': {}, + // 'all.application.events': expect.any(Object), + 'all.application.project': expect.any(Object), includeIndex: expect.any(Object), 'packagejson.scripts': {} })) @@ -304,6 +329,8 @@ extensions: 'all.application.manifest.full': { packages: { thepackage: 'takesover' } }, + // 'all.application.events': expect.any(Object), + 'all.application.project': expect.any(Object), 'all.application.manifest.package': undefined, 'all.application.hooks': { // already there diff --git a/test/jest.setup.js b/test/jest.setup.js index a652bc5..ac93db7 100644 --- a/test/jest.setup.js +++ b/test/jest.setup.js @@ -19,6 +19,11 @@ const eol = require('eol') const path = require('path') const fileSystem = require('jest-plugin-fs').default +const project = { + org: { + ims_org_id: "00000000000000000100000@AdobeOrg" + } +} // dont touch the real fs global.mockFs = () => { @@ -150,17 +155,18 @@ global.defaultAppHostName = 'adobeio-static.net' global.defaultTvmUrl = 'https://adobeio.adobeioruntime.net/apis/tvm/' global.defaultOwApihost = 'https://adobeioruntime.net' global.fakeS3Bucket = 'fake-bucket' -global.fakeOrgId = '00000000000000000100000@AdobeOrg' + global.fakeConfig = { tvm: { - project: { org: { ims_org_id: global.fakeOrgId } }, + project, runtime: { namespace: 'fake_ns', auth: 'fake:auth' } }, + project, local: { - project: { org: { ims_org_id: global.fakeOrgId } }, + project, runtime: { // those must match the once set by dev cmd apihost: 'http://localhost:3233', @@ -170,7 +176,7 @@ global.fakeConfig = { }, // todo delete those should not be passed via aio now creds: { - project: { org: { ims_org_id: global.fakeOrgId } }, + project, runtime: { namespace: 'fake_ns', auth: 'fake:auth' From 077d4008a675c5d69b8b430d882951313c4421d3 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 14 Apr 2023 17:41:43 -0700 Subject: [PATCH 5/9] add events tests back, full coverage --- src/index.js | 6 ++--- .../exc-with-events/app.config.yaml | 3 +++ .../__fixtures__/exc-with-events/package.json | 4 +++ .../src/dx-excshell-1/actions/action.js | 17 ++++++++++++ .../src/dx-excshell-1/actions/somefile.txt | 1 + .../src/dx-excshell-1/ext.config.yaml | 26 +++++++++++++++++++ .../src/dx-excshell-1/web-src/index.html | 18 +++++++++++++ test/index.test.js | 6 +++++ 8 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 test/__fixtures__/exc-with-events/app.config.yaml create mode 100644 test/__fixtures__/exc-with-events/package.json create mode 100644 test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js create mode 100644 test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt create mode 100644 test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml create mode 100644 test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html diff --git a/src/index.js b/src/index.js index 749a15e..c63f592 100644 --- a/src/index.js +++ b/src/index.js @@ -493,9 +493,9 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI config.app.hasFrontend = fs.existsSync(web) config.app.dist = path.resolve(dist, dist === defaultDistPath ? subFolderName : '') - // if (singleUserConfig.events) { - // config.events = { ...singleUserConfig.events } - // } + if (singleUserConfig.events) { + config.events = { ...singleUserConfig.events } + } if (commonConfig?.aio?.project) { config.project = commonConfig.aio.project } diff --git a/test/__fixtures__/exc-with-events/app.config.yaml b/test/__fixtures__/exc-with-events/app.config.yaml new file mode 100644 index 0000000..fa4da76 --- /dev/null +++ b/test/__fixtures__/exc-with-events/app.config.yaml @@ -0,0 +1,3 @@ +extensions: + 'dx/excshell/1': + $include: src/dx-excshell-1/ext.config.yaml diff --git a/test/__fixtures__/exc-with-events/package.json b/test/__fixtures__/exc-with-events/package.json new file mode 100644 index 0000000..57698ed --- /dev/null +++ b/test/__fixtures__/exc-with-events/package.json @@ -0,0 +1,4 @@ +{ + "version": "1.0.0", + "name": "exc" +} diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js new file mode 100644 index 0000000..c491ed6 --- /dev/null +++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js @@ -0,0 +1,17 @@ +/* +Copyright 2019 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +/** @private */ +function main (args) { + return 'hello' +} +exports.main = main diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt new file mode 100644 index 0000000..d9851e6 --- /dev/null +++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt @@ -0,0 +1 @@ +include me ! \ No newline at end of file diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml b/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml new file mode 100644 index 0000000..537a721 --- /dev/null +++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml @@ -0,0 +1,26 @@ +operations: + view: + - type: web + impl: index.html +actions: ./actions +web: ./web-src +events: + registrations: +runtimeManifest: + packages: + my-exc-package: + license: 'Apache-2.0' + actions: + action: + function: 'actions/action.js' + web: 'yes' + runtime: 'nodejs:14' + inputs: + LOG_LEVEL: 'debug' + annotations: + 'require-adobe-auth': true + final: true + include: + - [ 'actions/somefile.txt', 'file.txt' ] + limits: + concurrency: 189 diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html b/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html new file mode 100644 index 0000000..9bd20dd --- /dev/null +++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html @@ -0,0 +1,18 @@ + + + + + + + + + Runtime Starter + + + + + + + diff --git a/test/index.test.js b/test/index.test.js index 0659b41..bcaca71 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -56,6 +56,12 @@ describe('load config', () => { })) }) + test('exc with events config', async () => { + global.loadFixtureApp('exc-with-events') + config = loadConfig({}) + expect(config.all['dx/excshell/1']).toEqual(expect.objectContaining({events: expect.any(Object)})) + }) + test('standalone app, exc and nui extension config', async () => { global.loadFixtureApp('app-exc-nui') config = loadConfig({}) From 8b4290b026348a16ffac54c80a161ebc899c8ff3 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 14 Apr 2023 17:44:39 -0700 Subject: [PATCH 6/9] linting ... --- test/index.test.js | 2 +- test/jest.setup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/index.test.js b/test/index.test.js index bcaca71..ffa9609 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -59,7 +59,7 @@ describe('load config', () => { test('exc with events config', async () => { global.loadFixtureApp('exc-with-events') config = loadConfig({}) - expect(config.all['dx/excshell/1']).toEqual(expect.objectContaining({events: expect.any(Object)})) + expect(config.all['dx/excshell/1']).toEqual(expect.objectContaining({ events: expect.any(Object) })) }) test('standalone app, exc and nui extension config', async () => { diff --git a/test/jest.setup.js b/test/jest.setup.js index ac93db7..3d5280a 100644 --- a/test/jest.setup.js +++ b/test/jest.setup.js @@ -21,7 +21,7 @@ const path = require('path') const fileSystem = require('jest-plugin-fs').default const project = { org: { - ims_org_id: "00000000000000000100000@AdobeOrg" + ims_org_id: '00000000000000000100000@AdobeOrg' } } From 0288fc1620f3da632a326d215bda8fffe6561a81 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Fri, 14 Apr 2023 17:56:01 -0700 Subject: [PATCH 7/9] more coverage --- test/data-mocks/config-loader.js | 2 +- test/index.test.js | 3 ++- test/jest.setup.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/data-mocks/config-loader.js b/test/data-mocks/config-loader.js index 9068b60..1dfbaad 100644 --- a/test/data-mocks/config-loader.js +++ b/test/data-mocks/config-loader.js @@ -324,7 +324,7 @@ const applicationNoActionsSingleConfig = { }, root: `${root}`, name: 'application', - // events: {}, + events: {}, hooks: { 'pre-app-run': 'echo hello' } diff --git a/test/index.test.js b/test/index.test.js index ffa9609..330255f 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -76,7 +76,8 @@ describe('load config', () => { global.loadFixtureApp('app-no-actions') config = loadConfig({}) expect(config).toEqual(getMockConfig('app-no-actions', global.fakeConfig.tvm, { - 'all.application.project': expect.any(Object) + 'all.application.project': expect.any(Object), + 'all.application.events': expect.undefined })) }) diff --git a/test/jest.setup.js b/test/jest.setup.js index 3d5280a..64ceb18 100644 --- a/test/jest.setup.js +++ b/test/jest.setup.js @@ -164,6 +164,7 @@ global.fakeConfig = { auth: 'fake:auth' } }, + events: {}, project, local: { project, From ea339336ecfa5e05b2b7b6936eaa476800a708d3 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Mon, 17 Apr 2023 18:16:14 -0700 Subject: [PATCH 8/9] remove commented code --- test/data-mocks/config-loader.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/data-mocks/config-loader.js b/test/data-mocks/config-loader.js index 1dfbaad..4598869 100644 --- a/test/data-mocks/config-loader.js +++ b/test/data-mocks/config-loader.js @@ -331,9 +331,6 @@ const applicationNoActionsSingleConfig = { } } -// const applicationNoEventsSingleConfig = { ...applicationNoActionsSingleConfig } -// applicationNoEventsSingleConfig.application.events = {} - // expected return values from config loader for matching fixtures in __fixtures__ const expectedConfigs = { exc: { @@ -374,18 +371,6 @@ const expectedConfigs = { }, root }, - // 'app-no-events': { - // all: { ...applicationNoActionsSingleConfig }, - // implements: [ - // 'application' - // ], - // includeIndex: appNoActionsIncludeIndex, - // packagejson: { - // version: '1.0.0', - // name: 'app-no-actions' - // }, - // root - // }, 'app-no-actions': { all: { ...applicationNoActionsSingleConfig }, implements: [ From 33505fca19e548fca9889a4e40f23dea77fef9d8 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Mon, 17 Apr 2023 18:38:00 -0700 Subject: [PATCH 9/9] remove console log --- test/index.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/index.test.js b/test/index.test.js index 330255f..decb834 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -36,7 +36,6 @@ describe('load config', () => { test('standalone app config', async () => { global.loadFixtureApp('app') config = loadConfig() // {} or not for coverage - console.log('config = ', JSON.stringify(config, 0, 2)) const mockConfig = getMockConfig('app', global.fakeConfig.tvm, { 'all.application.project': expect.any(Object) })