4

I have updated my Angular 12 application to Angular 14 using ng update. The build was successful and can see my application running perfectly fine but my tests are failing. One of the errors I am getting is this:

Property 'configureTestingModule' doesn't exist on type TestBedStatic

Anyone know any workaround for this? Do I need to update my testing libraries?

@angular/core: ^14.2.0
jasmine-core: ~3.8.0
jasmine-marbles: ^0.8.3
karma: ~6.3.0
protractor: ^7.0.0

Sample test:

beforeEach( () => {
    TestBed.configureTestingModule({
        providers: []
    });
})
Aayushi Jain
  • 2,861
  • 2
  • 29
  • 36
  • 1
    what libraries are you using for testing? can you provide some code of a test setup file? updating testing libraries could be a valid solution. i was getting errors after upgrading angular because my jest version wasnt up to date – Fiehra Aug 29 '22 at 14:20
  • updated with libraries version – Aayushi Jain Aug 29 '22 at 14:24
  • mhm what you could also try is deleting node_modules and rerun your install command. maybe some old files are cached from the earlier angualr version – Fiehra Aug 29 '22 at 14:27
  • that I tried, no luck. – Aayushi Jain Aug 29 '22 at 14:27
  • i noticed a slight difference in my test setup which looks like this: beforeEach(async () => { TestBed.configureTestingModule({ ... }). note the async. – Fiehra Aug 29 '22 at 14:33

1 Answers1

5

enter image description here

  1. download the latest typescript version npm install -g typescript

  2. type tsc --version to check the version. (currently 4.8 is the latest)

  3. click on the version in vs code and update it if it wasn't updated.

  4. If you're using npm test, then look at the typescript version in package.json

Rstar37
  • 454
  • 5
  • 6