Lint
This commit is contained in:
@@ -3,7 +3,6 @@ import {Repository} from "@welshman/relay"
|
||||
import {get} from "svelte/store"
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from "vitest"
|
||||
import {
|
||||
adapter,
|
||||
custom,
|
||||
deriveEvents,
|
||||
deriveEventsMapped,
|
||||
@@ -114,28 +113,6 @@ describe("Store utilities", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("adapter", () => {
|
||||
it("should adapt between different types", () => {
|
||||
const source = synced<number>("test", 0)
|
||||
const adapted = adapter({
|
||||
store: source,
|
||||
forward: n => n.toString(),
|
||||
backward: s => parseInt(s, 10),
|
||||
})
|
||||
|
||||
const mockFn = vi.fn()
|
||||
adapted.subscribe(mockFn)
|
||||
|
||||
adapted.set("42")
|
||||
expect(get(source)).toBe(42)
|
||||
expect(mockFn).toHaveBeenLastCalledWith("42")
|
||||
|
||||
adapted.update(s => (parseInt(s, 10) + 1).toString())
|
||||
expect(get(source)).toBe(43)
|
||||
expect(mockFn).toHaveBeenLastCalledWith("43")
|
||||
})
|
||||
})
|
||||
|
||||
describe("Event-related stores", () => {
|
||||
const mockRepository = {
|
||||
query: vi.fn(),
|
||||
|
||||
Reference in New Issue
Block a user