Skip to content

Some test fail with Angular 15, almost all tests fail in 15.1.0-rc.0 #350

Closed
@e-oz

Description

@e-oz

To reproduce issue with Angular 15:

  1. Clone this repo.
  2. In attempt to run "npm i" you'll see that some dependencies are outdated and "npm i" can't run. In particular, "@ngrx/store" requries newer Angular, jest-preset-angular and "@angular-eslint/" packages versions also should be bumped.
    Here is the updated package.json:
{
  "name": "@testing-library/angular-app",
  "version": "0.0.0-semantically-released",
  "scripts": {
    "ng": "nx",
    "nx": "nx",
    "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main",
    "start": "nx serve",
    "prebuild": "rimraf dist",
    "build": "nx run-many --target=build --projects=testing-library",
    "build:schematics": "tsc -p ./projects/testing-library/tsconfig.schematics.json",
    "test": "nx run-many --target=test --all --parallel=1",
    "lint": "nx workspace-lint && nx lint",
    "e2e": "nx e2e",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "pre-commit": "lint-staged",
    "semantic-release": "semantic-release",
    "prepare": "git config core.hookspath .githooks"
  },
  "dependencies": {
    "@angular/animations": "15.0.0",
    "@angular/cdk": "15.0.0",
    "@angular/common": "15.0.0",
    "@angular/compiler": "15.0.0",
    "@angular/core": "15.0.0",
    "@angular/material": "15.0.0",
    "@angular/platform-browser": "15.0.0",
    "@angular/platform-browser-dynamic": "15.0.0",
    "@angular/router": "15.0.0",
    "@ngrx/store": "15.1.0",
    "@nrwl/angular": "15.2.1",
    "@nrwl/nx-cloud": "15.0.2",
    "@testing-library/dom": "^8.11.1",
    "rxjs": "7.5.6",
    "tslib": "~2.3.1",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "15.0.0",
    "@angular-eslint/builder": "15.1.0",
    "@angular-eslint/eslint-plugin": "15.1.0",
    "@angular-eslint/eslint-plugin-template": "15.1.0",
    "@angular-eslint/schematics": "15.1.0",
    "@angular-eslint/template-parser": "15.1.0",
    "@angular/cli": "~15.0.0",
    "@angular/compiler-cli": "15.0.0",
    "@angular/forms": "15.0.0",
    "@angular/language-service": "15.0.0",
    "@nrwl/cli": "15.2.1",
    "@nrwl/eslint-plugin-nx": "15.2.1",
    "@nrwl/jest": "15.2.1",
    "@nrwl/linter": "15.2.1",
    "@nrwl/node": "15.2.1",
    "@nrwl/nx-plugin": "15.2.1",
    "@nrwl/workspace": "15.2.1",
    "@swc-node/register": "^1.4.2",
    "@swc/core": "^1.2.173",
    "@testing-library/jasmine-dom": "^1.2.0",
    "@testing-library/jest-dom": "^5.15.1",
    "@testing-library/user-event": "^13.5.0",
    "@types/jasmine": "4.0.3",
    "@types/jest": "28.1.8",
    "@types/node": "18.7.1",
    "@typescript-eslint/eslint-plugin": "5.36.1",
    "@typescript-eslint/parser": "5.36.1",
    "cpy-cli": "^3.1.1",
    "eslint": "8.15.0",
    "eslint-config-prettier": "8.3.0",
    "eslint-plugin-import": "~2.25.4",
    "eslint-plugin-jasmine": "~4.1.3",
    "eslint-plugin-jest": "~25.3.4",
    "eslint-plugin-jest-dom": "~4.0.1",
    "eslint-plugin-testing-library": "~5.0.1",
    "jasmine-core": "4.2.0",
    "jasmine-spec-reporter": "7.0.0",
    "jest": "28.1.3",
    "jest-environment-jsdom": "28.1.3",
    "jest-preset-angular": "12.2.3",
    "karma": "6.4.0",
    "karma-chrome-launcher": "^3.1.0",
    "karma-jasmine": "5.1.0",
    "karma-jasmine-html-reporter": "2.0.0",
    "lint-staged": "^12.1.6",
    "ng-packagr": "15.0.0",
    "nx": "15.2.1",
    "postcss": "^8.4.5",
    "postcss-import": "14.1.0",
    "postcss-preset-env": "7.5.0",
    "postcss-url": "10.1.3",
    "prettier": "2.6.2",
    "rimraf": "^3.0.2",
    "semantic-release": "^18.0.0",
    "ts-jest": "28.0.8",
    "ts-node": "10.9.1",
    "typescript": "4.8.4"
  }
}
  1. Now you can run "npm i"
  2. Run "npx nx test example-app --skip-nx-cache"

Just 2 tests fail:

  1. is possible to fill in a form and verify error messages (with the help of jest-dom...
  2. set and show pre-set form values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions