angular/packages/core/schematics/migrations/test-bed-get
Joey Perrott 9a27c5befb build: rename defaults2.bzl to defaults.bzl (#63384)
Use defaults.bzl for the common macros

PR Close #63384
2025-08-25 15:45:46 -07:00
..
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
index.ts refactor(migrations): add migration for TestBed.get (#60414) 2025-03-19 15:52:26 +01:00
README.md refactor(migrations): add migration for TestBed.get (#60414) 2025-03-19 15:52:26 +01:00
test_bed_get_migration.ts refactor: support arbitrary stats/metrics in tsurge (#61272) 2025-05-14 11:05:55 +02:00

Remove TestBed.get migration

Replaces the usages of the deprecated TestBed.get method with the non-deprecated TestBed.inject:

Before

import { TestBed } from '@angular/core/testing';

describe('test', () => {
  it('should inject', () => {
    console.log(TestBed.get(SOME_TOKEN));
  });
});

After

import { TestBed } from '@angular/core/testing';

describe('test', () => {
  it('should inject', () => {
    console.log(TestBed.inject(SOME_TOKEN));
  });
});