ui5-community / generator-ui5-project

Generator for UI5-based web-apps which use the official UI5 tooling and support multiple deployment targets such as the SAP Business Technology Platform
Apache License 2.0
44 stars 27 forks source link

Tests `JS-Application Router @ Cloud Foundry` fails #45

Closed tobiasqueck closed 3 months ago

tobiasqueck commented 2 years ago

Easy-Ui5 version:

I am not running a released easy-ui5 version but run the tests in the repo.

OS/version:

MacOs/12.3.1

Browser/version (+device/version):

n/a

Other versions

yarn: 1.22.17 node: 14.18.1

Steps to reproduce the problem:

  1. Clone the repository
  2. yarn
  3. yarn test test/basic.js --grep 'JS-Application Router @ Cloud Foundry'

What is the expected result?

A successful test run.

What happens instead?

should pass the OPA tests fails

Any other information? (attach screenshot if possible)

I also tried it with npm instead of yarn but ran into the same issue.

Basic project capabilities
    XML
      ✔ should create the necessary ui5 files
      ✔ should create an installable project (23610ms)
      ✔ should run lint-fix (1828ms)
      ✔ should pass the OPA tests (10375ms)
    JS-Application Router @ Cloud Foundry
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (31709ms)
      ✔ should run lint-fix (2451ms)
      1) should pass the OPA tests
      ✔ should create an buildable project (16399ms)
    JSON-Local resources (SAPUI5)
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ should create an installable project (22355ms)
      ✔ should run lint-fix (2386ms)
      2) should pass the OPA tests
    JSON-Local resources (SAPUI5)-SAP NetWeaver
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ should create an installable project (24628ms)
      ✔ should run lint-fix (2380ms)
      3) should pass the OPA tests
    HTML-Local resources (OpenUI5)-Application Router @ Cloud Foundry
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (33025ms)
      ✔ should run lint-fix (2555ms)
      4) should pass the OPA tests
      ✔ should create an buildable project (65394ms)
    JSON-SAP Launchpad service
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (33701ms)
      ✔ should run lint-fix (2408ms)
      5) should pass the OPA tests
      ✔ should create an buildable project (4361ms)
    XML-SAP HTML5 Application Repository service for SAP BTP
      ✔ should create the necessary ui5 files
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (32904ms)
      ✔ should run lint-fix (2405ms)
      ✔ should pass the OPA tests (14378ms)
      ✔ should create an buildable project (16607ms)
    XML-SAP NetWeaver
      ✔ should create the necessary ui5 files
      ✔ should create an installable project (25570ms)
      ✔ should run lint-fix (2246ms)
      ✔ should pass the OPA tests (12527ms)
tobiasqueck commented 2 years ago

When someone looks at this, please also consider converting

it("should be able to create the project", function () {
    return helpers.run(path.join(__dirname, "../generators/app")).withPrompts(oPrompt);
});

into something like

let context;
before(async () => {
     context = await helpers.run(path.join(__dirname, "../generators/app")).withPrompts(oPrompt)
});

after(() => {
     context.restore();
});

so that the tests are isolated.

nicoschoenteich commented 3 months ago

Not relevant any longer with new version: PR https://github.com/ui5-community/generator-ui5-project/pull/75