-
Notifications
You must be signed in to change notification settings - Fork 91
Some test fail with Angular 15, almost all tests fail in 15.1.0-rc.0 #350
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
Comments
To reproduce issue with Angular 15.1.0-rc.0:
{
"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.1.0-rc.0",
"@angular/cdk": "15.1.0-rc.0",
"@angular/common": "15.1.0-rc.0",
"@angular/compiler": "15.1.0-rc.0",
"@angular/core": "15.1.0-rc.0",
"@angular/material": "15.0.0",
"@angular/platform-browser": "15.1.0-rc.0",
"@angular/platform-browser-dynamic": "15.1.0-rc.0",
"@angular/router": "15.1.0-rc.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.1.0-rc.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.1.0-rc.0",
"@angular/compiler-cli": "15.1.0-rc.0",
"@angular/forms": "15.1.0-rc.0",
"@angular/language-service": "15.1.0-rc.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"
}
}
Error for most of them:
|
Thanks for bringing this to my attention @e-oz But, I remember that I'll take a look at the rc.0 version. |
Sorry for not saying that clearly enough - tests fail with jest-preset-angular 12.2.3. I’m not asking to modify .npmrc - I did it just to make "npm i" work in the second case. My point is: Angular 15.1 has breaking change that you might want to consider and modify your code. |
|
Same issue as above with angular
|
is there any plan to fix this for ng 15.1.0? |
There is, i try to push it forward, because we need it in our project |
As a quick (temporary) fix, if you can't wait, you can run this postinstall ;-) const path = require('path');
const childProcess = require('child_process');
[
'../../node_modules/@testing-library/angular/fesm2020/testing-library-angular.mjs', // adjust to your folder structure
// add other files here if you need
].forEach((file) => {
const modulePath = path.join(__dirname, file).toString();
console.log('fixing ', modulePath);
let testingLibraryAngular = fs.readFileSync(modulePath).toString();
testingLibraryAngular = testingLibraryAngular.replace(
'ɵisStandalone',
'isStandalone'
);
fs.writeFileSync(modulePath, testingLibraryAngular);
});
// need to delete the cache after overwriting node_modules content
childProcess.execSync(`rm -rf ./.angular`, {
stdio: 'inherit',
}); |
To reproduce issue with Angular 15:
Here is the updated package.json:
Just 2 tests fail:
is possible to fill in a form and verify error messages (with the help of jest-dom...
set and show pre-set form values
The text was updated successfully, but these errors were encountered: