Skip to content

Commit

Permalink
rename tests (but will break)
Browse files Browse the repository at this point in the history
  • Loading branch information
charkour committed Jun 5, 2023
1 parent 243a444 commit a6723bb
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, vi } from 'vitest';
vi.mock('zustand');
import { createVanillaTemporal } from '../src/temporal';
import { temporalStateCreator } from '../src/temporal';
import { createStore } from 'zustand';
import { act } from 'react-dom/test-utils';
import { persist } from 'zustand/middleware';
Expand All @@ -12,9 +12,9 @@ interface MyState {
decrement: () => void;
}

// tests the createVanillaTemporal function rather than the temporal middleware
// tests the temporalStateCreator function rather than the temporal middleware
// Not exhaustive, but also likely not needed
describe('createVanillaTemporal', () => {
describe('temporalStateCreator', () => {
const store = createStore<MyState>((set) => {
return {
count: 0,
Expand All @@ -30,7 +30,7 @@ describe('createVanillaTemporal', () => {
});

it('should have the objects defined', () => {
const temporalStore = createVanillaTemporal(store.setState, store.getState);
const temporalStore = temporalStateCreator(store.setState, store.getState);
const { undo, redo, clear, pastStates, futureStates } =
temporalStore.getState();

Expand All @@ -47,7 +47,7 @@ describe('createVanillaTemporal', () => {

describe('should wrap temporal store in given middlewares', () => {
it('persist', () => {
const temporalStore = createVanillaTemporal(
const temporalStore = temporalStateCreator(
store.setState,
store.getState,
{ wrapTemporal: (store) => persist(store, { name: '123' }) },
Expand All @@ -56,7 +56,7 @@ describe('createVanillaTemporal', () => {
});

it('temporal', () => {
const temporalStore = createVanillaTemporal(
const temporalStore = temporalStateCreator(
store.setState,
store.getState,
{ wrapTemporal: (store) => temporal(store) },
Expand All @@ -65,7 +65,7 @@ describe('createVanillaTemporal', () => {
});

it('temporal and persist', () => {
const temporalStore = createVanillaTemporal(
const temporalStore = temporalStateCreator(
store.setState,
store.getState,
{ wrapTemporal: (store) => temporal(persist(store, { name: '123' })) },
Expand Down

0 comments on commit a6723bb

Please sign in to comment.