Open History to see the last commit
1/* eslint-disable @cspell/spellchecker */
2/**
3 * The code in this file is adapted from NG Extension Platform at https://ngxtension.netlify.app.
4 *
5 * Original Author: Chau Tran
6 *
7 * NG Extension Platform is an open-source project licensed under the MIT license.
8 *
9 * For more information about the original code, see
10 * https://github.com/nartc/ngxtension-platform
11 */
12/* eslint-enable */
13β
14import { TestBed } from '@angular/core/testing'
15import { createNoopInjectionToken } from './create-injection-token'
16β
17describe(createNoopInjectionToken.name, () => {
18 describe('given an injection token', () => {
19 const [injectFn, provideFn] = createNoopInjectionToken<number, true>(
20 'noop',
21 { multi: true },
22 )
23 it('then work properly', () => {
24 TestBed.configureTestingModule({
25 providers: [provideFn(1), provideFn(() => 2)],
26 }).runInInjectionContext(() => {
27 const values = injectFn()
28 expect(values).toEqual([1, 2])
29 })
30 })
31 })
32})