Skip to content

Commit 24e26af

Browse files
committed
test: review
1 parent 868f91d commit 24e26af

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

packages/router/__tests__/history/memory.spec.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import { createMemoryHistory } from '../../src/history/memory'
2-
import { START, HistoryLocation, HistoryState } from '../../src/history/common'
2+
import { START, HistoryLocation } from '../../src/history/common'
33
import { vi, describe, expect, it } from 'vitest'
44

55
const loc: HistoryLocation = '/foo'
66

77
const loc2: HistoryLocation = '/bar'
88

9-
const state: HistoryState = { foo: 'bar' }
10-
11-
const state2: HistoryState = { foo: 'baz' }
12-
139
describe('Memory history', () => {
1410
it('starts in nowhere', () => {
1511
const history = createMemoryHistory()
@@ -57,12 +53,12 @@ describe('Memory history', () => {
5753

5854
it('stores a state', () => {
5955
const history = createMemoryHistory()
60-
history.push(loc, state)
61-
expect(history.state).toEqual(state)
62-
history.push(loc, state2)
63-
expect(history.state).toEqual(state2)
56+
history.push(loc, { foo: 'bar' })
57+
expect(history.state).toEqual({ foo: 'bar' })
58+
history.push(loc, { foo: 'baz' })
59+
expect(history.state).toEqual({ foo: 'baz' })
6460
history.go(-1)
65-
expect(history.state).toEqual(state)
61+
expect(history.state).toEqual({ foo: 'bar' })
6662
})
6763

6864
it('does nothing with back if queue contains only one element', () => {

0 commit comments

Comments
 (0)