Skip to content

Commit

Permalink
add events tests back, full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Apr 15, 2023
1 parent c33f414 commit 077d400
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions test/__fixtures__/exc-with-events/app.config.yaml
@@ -0,0 +1,3 @@
extensions:
'dx/excshell/1':
$include: src/dx-excshell-1/ext.config.yaml
4 changes: 4 additions & 0 deletions test/__fixtures__/exc-with-events/package.json
@@ -0,0 +1,4 @@
{
"version": "1.0.0",
"name": "exc"
}
@@ -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
@@ -0,0 +1 @@
include me !
@@ -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
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="shortcut icon" href="https://wwwimages2.adobe.com/favicon.ico">
<title>Runtime Starter</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
</body>

</html>
6 changes: 6 additions & 0 deletions test/index.test.js
Expand Up @@ -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)}))

Check failure on line 62 in test/index.test.js

View workflow job for this annotation

GitHub Actions / build (14.x, ubuntu-latest)

A space is required after '{'

Check failure on line 62 in test/index.test.js

View workflow job for this annotation

GitHub Actions / build (14.x, ubuntu-latest)

A space is required before '}'
})

test('standalone app, exc and nui extension config', async () => {
global.loadFixtureApp('app-exc-nui')
config = loadConfig({})
Expand Down

0 comments on commit 077d400

Please sign in to comment.