Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get return last known value #427

Open
unional opened this issue Dec 5, 2022 · 2 comments
Open

get return last known value #427

unional opened this issue Dec 5, 2022 · 2 comments

Comments

@unional
Copy link
Collaborator

unional commented Dec 5, 2022

If there are getProperty invoked during simulation but there are not more recorded get action, the last value should be returned.

It is possible that during simulation it tries to make more get (or the get was not recorded some how during save)

@unional
Copy link
Collaborator Author

unional commented Dec 29, 2022

  // console.log(tyepof res.data) // string
  if (!res.data) return []
  if (res.data) return []
  console.log('what!!', typeof res.data) // undefined

should be either strict (throws MissingAction) or return last known value.

If not, the result is very confusing and hard to realize

@unional
Copy link
Collaborator Author

unional commented Feb 7, 2023

A problem is that there are a lot of extra calls made by system, TypeScript (e.g. look for .then),
library (e.g. @ungap/structured-clone looks for .toJSON. It is removed in 8.0),
and assertion library (e.g. jest's expect().toEqual() make extra checks that is hidden).

It is quite a hard thing to handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant