mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
feat(challengestandalone): challenge standalone
This commit is contained in:
1
libs/module-to-standalone/core/providers/src/index.ts
Normal file
1
libs/module-to-standalone/core/providers/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib/token.provider';
|
||||
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
EnvironmentProviders,
|
||||
InjectionToken,
|
||||
makeEnvironmentProviders,
|
||||
} from '@angular/core';
|
||||
|
||||
export const TOKEN = new InjectionToken<string[]>('token');
|
||||
|
||||
export const provideToken = (token: string): EnvironmentProviders => {
|
||||
return makeEnvironmentProviders([
|
||||
{
|
||||
provide: TOKEN,
|
||||
useValue: token,
|
||||
},
|
||||
]);
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
||||
globalThis.ngJest = {
|
||||
testEnvironmentOptions: {
|
||||
errorOnUnknownElements: true,
|
||||
errorOnUnknownProperties: true,
|
||||
},
|
||||
};
|
||||
import 'jest-preset-angular/setup-jest';
|
||||
Reference in New Issue
Block a user