Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array.map error after upgrading packages and changing to pnpm #24

Closed
azehintense opened this issue Nov 13, 2024 · 2 comments
Closed

Array.map error after upgrading packages and changing to pnpm #24

azehintense opened this issue Nov 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@azehintense
Copy link

Hi. I can't get version 1.0.0 to work. What am i doing wrong? The packages seem to work otherwise.

I get this error:
image

This is my package.json:

{
    "name": "cdt",
    "version": "2.0.0",
    "private": true,
    "packageManager": "pnpm@9.12.2",
    "engines": {
        "node": ">=18.14.0",
        "pnpm": ">=9"
    },
    "devDependencies": {
        "@openui5/types": "^1.130.0",
        "@types/node": "^22.9.0",
        "@types/qunit": "^2.19.12",
        "@ui5/middleware-code-coverage": "^1.1.1",
        "@wdio/browser-runner": "^9.2.11",
        "@wdio/cli": "^9.2.11",
        "@wdio/devtools-service": "^8.40.2",
        "@wdio/junit-reporter": "^9.2.2",
        "@wdio/local-runner": "^9.2.11",
        "@wdio/mocha-framework": "^9.2.8",
        "@wdio/spec-reporter": "^9.2.8",
        "@wdio/static-server-service": "^9.2.2",
        "@wdio/types": "^9.2.2",
        "@wdio/visual-service": "^4.1.3",
        "chart.js": "^3.9.1",
        "concurrently": "^8.2.2",
        "eslint": "^9.14.0",
        "eslint-config-mlauffer-nodejs": "^3.0.0",
        "eslint-plugin-mocha": "^10.5.0",
        "eslint-plugin-wdio": "^9.2.11",
        "file-system": "^1.2.9",
        "globals": "^15.12.0",
        "prettier": "^3.3.3",
        "qunit": "^2.22.0",
        "ts-node": "^10.9.2",
        "tsx": "^4.19.2",
        "typescript": "^5.6.3",
        "typescript-eslint": "^8.13.0",
        "ui5-tooling-less": "^3.2.1",
        "ui5-tooling-modules": "^3.18.4",
        "vitest": "^2.1.4",
        "wait-on": "^7.2.0",
        "wdio-qunit-service": "^1.0.0"
    },
    "scripts": {
        "preinstall": "npx only-allow pnpm",
        "installAndUpdate": "pnpm install && pnpm update && pnpm audit fix --force || true",
        "test": "TYPE=unit pnpm run runTests",
        "runTests": "npx concurrently -n \"server,tests\" -k -t 60s -s \"command-tests\" \"ui5 serve --p=8484\" \"npx wait-on http://localhost:8484 && pnpm run $TYPE\"",
        "unit": "npx wdio run ./webapp/test/unit/wdio.conf.js --remote-debugging-port=9222 --remote-debugging-host=0.0.0.0 --debug",
        "silentServe": "ui5 serve --p=8484",
        "updateWDIO": "rm -rf node-modules package-lock.json && pnpm i @wdio/cli@latest @wdio/local-runner@latest @wdio/mocha-framework@latest --save-dev",
        "integrationTest": "TYPE=integration pnpm run runTests --verbose",
        "integration": "npx wdio run ./webapp/test/integration/wdio.conf.js --remote-debugging-port=9222 --remote-debugging-host=0.0.0.0",
        "serve": "ui5 serve --open index.html --p=8081",
        "build": "ui5 build --all"
    },
    "dependencies": {
        "@sap-theming/theming-base-content": "^11.22.0",
        "@ui5/cli": "^3.11.4",
        "less": "^4.2.0",
        "selenium-webdriver": "^4.26.0"
    }
}

And this is my new pnpm-workspace.yaml:

packages:
  # include packages in subfolders (e.g. apps/ and packages/)
  - "apps/**"
  - 'packages/**'
  # if required, exclude some directories
  - '!**/test/**'

Btw love your work!

@mauriciolauffer
Copy link
Owner

hi @azehintense , thanks for catching this one :)

The error was due to array values in QUnit assertion results actual/expected as seem in this SAP openui5-sample-app example.

I've fixed the issue in v1.0.1 and added some tests for these scenarios.

QUnit.test(
"Should pass dummy no module test with object/array assert",
(assert) => {
const mix = [[{ x: [1, 2, 3] }, { z: [{ a: "A", b: "B" }] }], {}];
assert.deepEqual({}, {});
assert.deepEqual([], []);
assert.deepEqual([{}], [{}]);
assert.deepEqual([[{}]], [[{}]]);
assert.deepEqual(mix, [
[{ x: [1, 2, 3] }, { z: [{ a: "A", b: "B" }] }],
{},
]);
},
);

@mauriciolauffer mauriciolauffer added the bug Something isn't working label Nov 24, 2024
@azehintense
Copy link
Author

Thank you <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants