-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tests #3
Comments
If I may, I'd like to suggest zora - a very modern little test-framework with great performance and familiar surface ergonomics. For one, it does async tests way more reliably than pretty much any test-framework I've come across, which is why I found it and started using it in the first place. (It's very not "batteries included", which I like, but YMMV... tap-diff is my go-to tap reporter.) For my own DOM integration tests, I've been using undom - it's extremely simple and probably just enough for testing things that don't depend on much more than |
Thanks for the tips! I'll checkout zora. I had been using ospec back when I was whiteboarding the reactive library here https://github.com/heyheyhello/haptic-reactivity/blob/work/test/sGlobalTests.js. I picked ospec at the time for the same reasons zora is preaching - be simple and light - but didn't love it. Yeah I love undom! I actually forked it to https://github.com/heyheyhello/softdom/ when I was doing Sinuous SSR+SSG a few months back. |
Read subscribe is...complicated. Especially with the lazy computed signals. Current implementation: // Case: Read-Subscribe. Marks the core registered in `$` as a reader
// This could be different than the actively running core, but shouldn't be
else if ((read = args[0] && (args[0] as { $$?: 1 }).$$ && args[0].core)) {
if ((read as C).sigRP.has(signal)) {
throw new Error(`${(read as C).name} mixes sig($) & sig()`);
}
// Two-way link. Signal writes will now call/update core C
(read as C).sigRS.add(signal);
signal.cores.add((read as C));
// Computed-signals (signals holding a core; signal.cc) can't only run C
// when written to, they also need to run C when cc is marked stale. How
// do we know when that happens? It'll be when one of cc.sigRS signals
// calls cc. So, link this `read` core to each cc.sigRS call list; it'll
// be called as collateral.
if (signal.cc) {
signal.cc.sigRS.forEach((_signal) => {
// Linking _must_ be two-way. From signal.cores to core.sigXYZ. Until
// now it's always either sigRP or sigRP, but if we use those we'll
// break the mix error checking (above). So use a new list, sigIC.
(read as C).sigIC.add(_signal);
_signal.cores.add((read as C));
});
}
} I'll want to have some specific tests for this, addressing these from Sinuous: |
The reactive state library has a lot of new features/fixes over previous versions. These should be tested. Here are some initial tests to have:
The text was updated successfully, but these errors were encountered: