Skip to content

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

Closed
e-oz opened this issue Jan 10, 2023 · 8 comments
Closed

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

e-oz opened this issue Jan 10, 2023 · 8 comments

Comments

@e-oz
Copy link

e-oz commented Jan 10, 2023

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
@e-oz
Copy link
Author

e-oz commented Jan 10, 2023

To reproduce issue with Angular 15.1.0-rc.0:

  1. This version is not supported (although the change should be noted to developers of this library, that's why I'm reporting it), so we'll have to add 2 lines to .npmrc:
legacy-peer-deps = true
strict-peer-dependencies = false
  1. Run "rm -rf node_modules" if you have performed steps from my previous comment.
  2. Bump Angular versions to 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"
  }
}
  1. Run "npm i"
  2. Run "npx nx test example-app --skip-nx-cache"
Test Suites: 20 failed, 5 passed, 25 total
Tests:       32 failed, 10 passed, 42 total

Error for most of them:

TypeError: (0 , core_1.ɵisStandalone) is not a function

@e-oz e-oz changed the title Some test fail with Angular 15, all tests fail in 15.rc-0 Some test fail with Angular 15, almost all tests fail in 15.1.0-rc.0 Jan 10, 2023
@timdeschryver
Copy link
Member

Thanks for bringing this to my attention @e-oz
Ideally, we don't need to add legacy-peer-deps=true

But, I remember that jest-preset-angular did not upgrade to NGv15 when I upgrades this repo to v15, and I forgot about it.
I suppose upgrading from 12.2.2 to 12.2.3 should resolve that issue now.
Do you want to create a PR for this?
We can do the same for angular-eslint and ngrx.

I'll take a look at the rc.0 version.

@e-oz
Copy link
Author

e-oz commented Jan 10, 2023

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.

@sysmat
Copy link

sysmat commented Jan 12, 2023

  • "@testing-library/angular": "^13.0.2"
Angular CLI: 15.1.0
Node: 18.12.1
Package Manager: npm 8.18.0
OS: win32 x64

Angular: 15.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1501.0
@angular-devkit/build-angular   15.1.0
@angular-devkit/core            15.1.0
@angular-devkit/schematics      15.1.0
@schematics/angular             15.1.0
rxjs                            7.8.0
typescript                      4.9.4
  • error:
./node_modules/@testing-library/angular/fesm2020/testing-library-angular.mjs:336:54-67 - Error: export 'ɵisStandalone' (imported as 'ɵisStandalone') was not found in '@angular/core' (possible exports: ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactoryResolver, ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory, NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isStandalone, makeEnvironmentProviders, platformCore, reflectComponentType, resolveForwardRef, setTestabilityGetter, ɵALLOW_MULTIPLE_PLATFORMS, ɵAPP_ID_RANDOM_PROVIDER, ɵChangeDetectorStatus, ɵComponentFactory, ɵConsole, ɵDEFAULT_LOCALE_ID, ɵINJECTOR_SCOPE, ɵLContext, ɵLifecycleHooksFeature, ɵLocaleDataIndex, ɵNG_COMP_DEF, ɵNG_DIR_DEF, ɵNG_ELEMENT_ID, ɵNG_INJ_DEF, ɵNG_MOD_DEF, ɵNG_PIPE_DEF, ɵNG_PROV_DEF, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, ɵNO_CHANGE, ɵNgModuleFactory, ɵNoopNgZone, ɵReflectionCapabilities, ɵRender3ComponentFactory, ɵRender3ComponentRef, ɵRender3NgModuleRef, ɵRuntimeError, ɵTESTABILITY, ɵTESTABILITY_GETTER, ɵViewRef, ɵXSS_SECURITY_URL, ɵ_sanitizeHtml, ɵ_sanitizeUrl, ɵallowSanitizationBypassAndThrow, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustResourceUrl, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustUrl, ɵclearResolutionOfComponentResourcesQueue, ɵcoerceToBoolean, ɵcompileComponent, ɵcompileDirective, ɵcompileNgModule, ɵcompileNgModuleDefs, ɵcompileNgModuleFactory, ɵcompilePipe, ɵconvertToBitFlags, ɵcreateInjector, ɵdefaultIterableDiffers, ɵdefaultKeyValueDiffers, ɵdetectChanges, ɵdevModeEqual, ɵfindLocaleData, ɵflushModuleScopingQueueAsMuchAsPossible, ɵformatRuntimeError, ɵgetDebugNode, ɵgetDebugNodeR2, ɵgetDirectives, ɵgetHostElement, ɵgetInjectableDef, ɵgetLContext, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵglobal, ɵinjectChangeDetectorRef, ɵinternalCreateApplication, ɵisBoundToModule, ɵisDefaultChangeDetectionStrategy, ɵisEnvironmentProviders, ɵisInjectable, ɵisListLikeIterable, ɵisObservable, ɵisPromise, ɵisSubscribable, ɵivyEnabled, ɵmakeDecorator, ɵnoSideEffects, ɵpatchComponentDefWithScope, ɵpublishDefaultGlobalUtils, ɵpublishGlobalUtil, ɵregisterLocaleData, ɵresetCompiledComponents, ɵresetJitOptions, ɵresolveComponentResources, ɵsetAllowDuplicateNgModuleIdsForTest, ɵsetClassMetadata, ɵsetCurrentInjector, ɵsetDocument, ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵstore, ɵstringify, ɵtransitiveScopesFor, ɵunregisterLocaleData, ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, 
ɵɵviewQuery)

@kle-pra
Copy link

kle-pra commented Jan 12, 2023

Same issue as above with angular 15.1.0 & @testing-library/angular": "^13.0.2

./node_modules/@testing-library/angular/fesm2020/testing-library-angular.mjs:336:54-67 - Error: export 'ɵisStandalone' (imported as 'ɵisStandalone') was not found in '@angular/core' (possible exports: ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ...

Angular CLI: 15.1.0
Node: 18.12.1
Package Manager: npm 8.19.2
OS: linux x64

Angular: 15.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1501.0
@angular-devkit/build-angular   15.1.0
@angular-devkit/core            15.1.0
@angular-devkit/schematics      15.1.0
@schematics/angular             15.1.0
rxjs                            7.8.0
typescript                      4.8.4

@sysmat
Copy link

sysmat commented Jan 13, 2023

is there any plan to fix this for ng 15.1.0?

@TrustNoOneElse
Copy link
Contributor

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

@Markus-Ende
Copy link

Markus-Ende commented Jan 13, 2023

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',
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants