message: Fix di-errors tests
diff: @@ -6,7 +6,7 @@ test('No Injectable error', () => {
  // @ts-ignore
  constructor(dep: any) {}
  }
  - expect(() => ReflectiveInjector.create('main', [NoAnnotations])).toThrowError(
  + expect(() => ReflectiveInjector.resolve([NoAnnotations])).toThrowError(
  `Missing @Injectable decorator for 'NoAnnotations'`
  );
  });
  @@ -21,7 +21,7 @@ test('No Annotation error', () => {
  constructor(data: Data, dep: any) {}
  }
  - expect(() => ReflectiveInjector.create('main', [NoAnnotations])).toThrowError(
  + expect(() => ReflectiveInjector.resolve([NoAnnotations])).toThrowError(
  `Cannot resolve all parameters for 'NoAnnotations'(Data, ?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'NoAnnotations' is decorated with Injectable.`
  );
  });
  @@ -30,7 +30,9 @@ test('Circular dependencies error', () => {
  const Foo = new InjectionToken<string>('Foo');
  const Bar = new InjectionToken<string>('Bar');
  - const injector = ReflectiveInjector.create('main', [
  + const injector = ReflectiveInjector.createFromResolved({
  + name: 'main',
  + providers: ReflectiveInjector.resolve([
  {
  provide: Foo,
  useFactory(bar: string) {
  @@ -45,7 +47,8 @@ test('Circular dependencies error', () => {
  },
  deps: [Foo],
  },
  - ]);
  + ]),
  + });
  expect(() => injector.get(Foo)).toThrowError(
  'Cannot instantiate cyclic dependency! (InjectionToken Foo -> InjectionToken Bar -> InjectionToken Foo)'
  @@ -55,7 +58,10 @@ test('Circular dependencies error', () => {
  test('No provider error', () => {
  const Foo = new InjectionToken<string>('Foo');
  - const injector = ReflectiveInjector.create('main', []);
  + const injector = ReflectiveInjector.createFromResolved({
  + name: 'main',
  + providers: [],
  + });
  expect(() => injector.get(Foo)).toThrowError(
  'No provider for InjectionToken Foo'
  @@ -65,14 +71,17 @@ test('No provider error', () => {
  test('Instantiation error', () => {
  const Foo = new InjectionToken<string>('Foo');
  - const injector = ReflectiveInjector.create('main', [
  + const injector = ReflectiveInjector.createFromResolved({
  + name: 'main',
  + providers: ReflectiveInjector.resolve([
  {
  provide: Foo,
  useFactory() {
  throw new Error('expected error');
  },
  },
  - ]);
  + ]),
  + });
  expect(() => injector.get(Foo)).toThrowError(
  'Error during instantiation of InjectionToken Foo: expected error - in main'
  @@ -80,15 +89,12 @@ test('Instantiation error', () => {
  });
  test('Invalid provider error', () => {
  - expect(() => ReflectiveInjector.create('main', [true as any])).toThrowError(
  + expect(() =>
  + ReflectiveInjector.createFromResolved({
  + name: 'main',
  + providers: ReflectiveInjector.resolve([true as any]),
  + })
  + ).toThrowError(
  'Invalid provider - only instances of Provider and Type are allowed, got: true'
  );
  });
  -
  -// import {
  -// noAnnotationError,
  -// cyclicDependencyError,
  -// noProviderError,
  -// instantiationError,
  -// invalidProviderError,
  -// } from '../src/di/errors';
  