You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Describe the Bug
On three different applications Angular are failing all test that use @angular-devkit/schematics. Two of the applications were passing fine on Angular 17.2.0 but failed after upgrading to 17.3.7. The third application was a new one that was created on 17.3.7 to just for testing purses.
Standard jest tests, eg testing 'Hello world' are passing. But anything using schematics is throwing with the error The encoded data was not valid for encoding utf-8.
Minimal Reproduction
Create a new Angular application on 17.3.7 (latest version). Change to using Jest. Create a unit test that uses any schematics, and it throws with an encoding utf-8 error.
Expected Behavior
Expect test to be able to run against anything with schematics, not to straight away fail.
Error: Schematic "hello-world" not found in collection "schematics".
at SchematicEngine.createSchematic (/node_modules/@angular-devkit/schematics/src/engine/engine.js:246:23)
at CollectionImpl.createSchematic (/node_modules/@angular-devkit/schematics/src/engine/engine.js:82:29)
at SchematicTestRunner.runSchematic (/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.js:63:44)
at /src/app/schematic-test.spec.ts:14:31
at _ZoneDelegate.invoke (/node_modules/zone.js/bundles/zone.umd.js:412:32)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (/node_modules/zone.js/bundles/zone-testing.umd.js:2164:43)
at _ZoneDelegate.invoke (/node_modules/zone.js/bundles/zone.umd.js:411:38)
at ZoneImpl.run (/node_modules/zone.js/bundles/zone.umd.js:147:47)
at Object.wrappedFunc (/node_modules/zone.js/bundles/zone-testing.umd.js:450:38)
at Promise.then.completed (/node_modules/jest-circus/build/utils.js:298:28)
at new Promise (<anonymous>)
at callAsyncCircusFn (/node_modules/jest-circus/build/utils.js:231:10)
at _callCircusTest (/node_modules/jest-circus/build/run.js:316:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _runTest (/node_modules/jest-circus/build/run.js:252:3)
at async _runTestsForDescribeBlock (/node_modules/jest-circus/build/run.js:126:9)
at async _runTestsForDescribeBlock (/node_modules/jest-circus/build/run.js:121:9)
at async run (/node_modules/jest-circus/build/run.js:71:3)
at async runAndTransformResultsToJestFormat (/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
Please provide the environment you discovered this bug in (run ng version)
This is unfortunately a longstanding defect within Jest itself. As mentioned above, a workaround is available in the next release of Angular.
For more details please see: jestjs/jest#2549
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Describe the Bug
On three different applications Angular are failing all test that use @angular-devkit/schematics. Two of the applications were passing fine on Angular 17.2.0 but failed after upgrading to 17.3.7. The third application was a new one that was created on 17.3.7 to just for testing purses.
Standard jest tests, eg testing 'Hello world' are passing. But anything using schematics is throwing with the error The encoded data was not valid for encoding utf-8.
Minimal Reproduction
Create a new Angular application on 17.3.7 (latest version). Change to using Jest. Create a unit test that uses any schematics, and it throws with an encoding utf-8 error.
Expected Behavior
Expect test to be able to run against anything with schematics, not to straight away fail.
Environment
Test file example:
Please provide a link to a minimal reproduction of the bug
https://github.com/cathey191/test-jest
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: