Skip to content

Commit

Permalink
add failing tests for unstable_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
David Maskasky committed Jun 7, 2024
1 parent 0bc4692 commit b7325d1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/vanilla/store.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ describe('unstable_resolve resolves the correct value for', () => {

it('primitive atom', async () => {
const store = createStore()
store.unstable_resolve = <T,>(atom: Atom<T>): Atom<T> => {
if (atom === (pseudo as Atom<unknown>)) {
return a as unknown as Atom<T>
store.unstable_resolve = (atom: Atom<unknown>): Atom<unknown> => {
if (atom === pseudo) {
return a
}
return atom
}
Expand All @@ -476,9 +476,9 @@ describe('unstable_resolve resolves the correct value for', () => {

it('derived atom', async () => {
const store = createStore()
store.unstable_resolve = <T,>(atom: Atom<T>): Atom<T> => {
if (atom === (pseudo as Atom<unknown>)) {
return a as unknown as Atom<T>
store.unstable_resolve = (atom: Atom<unknown>): Atom<unknown> => {
if (atom === pseudo) {
return a
}
return atom
}
Expand Down Expand Up @@ -516,9 +516,9 @@ describe('unstable_resolve resolves the correct value for', () => {

it('writable atom', async () => {
const store = createStore()
store.unstable_resolve = <T,>(atom: Atom<T>): Atom<T> => {
if (atom === (pseudo as Atom<unknown>)) {
return a as unknown as Atom<T>
store.unstable_resolve = (atom: Atom<unknown>): Atom<unknown> => {
if (atom === pseudo) {
return a
}
return atom
}
Expand Down Expand Up @@ -548,9 +548,9 @@ describe('unstable_resolve resolves the correct value for', () => {

it('this in read and write', async () => {
const store = createStore()
store.unstable_resolve = <T,>(atom: Atom<T>): Atom<T> => {
store.unstable_resolve = (atom: Atom<unknown>): Atom<unknown> => {
if (atom === pseudo) {
return this_read as Atom<T>
return this_read
}
return atom
}
Expand All @@ -564,9 +564,9 @@ describe('unstable_resolve resolves the correct value for', () => {
this_read.debugLabel = 'this_read'
expect(store.get(pseudo)).toBe('this_read')

store.unstable_resolve = <T,>(atom: Atom<T>): Atom<T> => {
store.unstable_resolve = (atom: Atom<unknown>): Atom<unknown> => {
if (atom === pseudo) {
return this_write as unknown as Atom<T>
return this_write
}
return atom
}
Expand Down

0 comments on commit b7325d1

Please sign in to comment.