Skip to content

Commit

Permalink
chore: rename test helper to createLocalStore
Browse files Browse the repository at this point in the history
  • Loading branch information
markostanimirovic committed Sep 21, 2023
1 parent 34f544e commit f1eda7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions modules/signals/spec/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export function testEffects(testFn: (tick: () => void) => void): () => void {
};
}

export function initializeLocalStore<StoreClass extends Type<unknown>>(
Store: StoreClass
export function createLocalStore<Store extends Type<unknown>>(
storeToken: Store
): {
store: InstanceType<StoreClass>;
store: InstanceType<Store>;
destroy: () => void;
} {
@Component({
standalone: true,
template: '',
providers: [Store],
providers: [storeToken],
})
class TestComponent {
store = inject(Store);
store = inject(storeToken);
}

const fixture = TestBed.configureTestingModule({
Expand Down
8 changes: 4 additions & 4 deletions modules/signals/spec/signal-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
withState,
} from '../src';
import { STATE_SIGNAL } from '../src/signal-state';
import { initializeLocalStore } from './helpers';
import { createLocalStore } from './helpers';

describe('signalStore', () => {
describe('creation', () => {
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('signalStore', () => {
})
);

initializeLocalStore(Store).destroy();
createLocalStore(Store).destroy();

expect(message).toBe('onDestroy');
});
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('signalStore', () => {
})
);

initializeLocalStore(Store).destroy();
createLocalStore(Store).destroy();

expect(message).toBe('onDestroy');
});
Expand All @@ -256,7 +256,7 @@ describe('signalStore', () => {
},
})
);
const { destroy } = initializeLocalStore(Store);
const { destroy } = createLocalStore(Store);

expect(messages).toEqual(['onInit']);

Expand Down

0 comments on commit f1eda7f

Please sign in to comment.