Skip to content

Commit

Permalink
test: reword tests descriptions (no should)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed Mar 13, 2024
1 parent 9383dca commit d220193
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ImmerComponentStore, provideImmerComponentStore } from 'ngrx-immer/comp
import { provideComponentStore } from '@ngrx/component-store';


test('provideImmerComponentStore() should equal provideComponentStore()', () => {
test('provideImmerComponentStore() equals provideComponentStore()', () => {
const ngrxProviders = provideComponentStore(DummyImmerComponentStore as any);

const ngrxImmerProviders = provideImmerComponentStore(DummyImmerComponentStore);
Expand Down
20 changes: 10 additions & 10 deletions src/signals/tests/immer-patch-state.jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ describe('immerPatchState', () => {
return new UserState();
};

it('should do a sanity check', () => {
it('smoketest', () => {
const userState = setup();
expect(userState.id()).toBe(1);
});

it('should be type-safe', () => {
it('is type-safe', () => {
const userState = setup();

//@ts-expect-error number is not a property
Expand All @@ -39,7 +39,7 @@ describe('immerPatchState', () => {
immerPatchState(userState, (state) => ({ number: 1 }));
});

it('should allow patching with object literal', () => {
it('allows patching with object literal', () => {
const userState = setup();
immerPatchState(userState, {
name: { firstname: 'Lucy', lastname: 'Sanders' },
Expand All @@ -48,15 +48,15 @@ describe('immerPatchState', () => {
});

describe('update with return value', () => {
it('should work with the default patch function', () => {
it('works with the default patch function', () => {
const userState = setup();
immerPatchState(userState, ({ name }) => ({
name: { firstname: name.firstname, lastname: 'Sanders' },
}));
expect(userState.prettyName()).toBe('Konrad Sanders');
});

it('should work with chained patch functions', () => {
it('works with chained patch functions', () => {
const userState = setup();

function updateNames<
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('immerPatchState', () => {
expect(userState.address()).toEqual({ city: 'Updated', zip: '1234' });
});

it('should not emit other signals', () => {
it('does not emit other signals', () => {
TestBed.runInInjectionContext(() => {
let effectCounter = 0;
const userState = setup();
Expand All @@ -108,7 +108,7 @@ describe('immerPatchState', () => {
});
});

it('should throw if a mutated patched state is returned', () => {
it('throws if a mutated patched state is returned', () => {
const userState = setup();

expect(() =>
Expand All @@ -123,15 +123,15 @@ describe('immerPatchState', () => {
});

describe('update without returning a value', () => {
it('should allow a mutable update', () => {
it('allows a mutable update', () => {
const userState = setup();
immerPatchState(userState, (state) => {
state.name = { firstname: 'Lucy', lastname: 'Sanders' };
});
expect(userState.prettyName()).toBe('Lucy Sanders');
});

it('should not emit other signals', () => {
it('does not emit other signals', () => {
TestBed.runInInjectionContext(() => {
let effectCounter = 0;
const userState = setup();
Expand All @@ -152,7 +152,7 @@ describe('immerPatchState', () => {
});
});

it('should check the Signal notification on multiple updates', () => {
it('checks the Signal notification on multiple updates', () => {
TestBed.runInInjectionContext(() => {
// setup effects
let addressEffectCounter = 0;
Expand Down

0 comments on commit d220193

Please sign in to comment.