Comments (2)
I don't think you can do this out of box, looks like you'd like to resolve marble to key but currently always falls to value to draw marbles. Main design comes due to key for marble observable is arbitrary value, actual value we care about is value itself (if key === value that doesn't matter though). Not sure if I'll spend time to create additional path for this logic.
from rx-sandbox.
Main design comes due to key for marble observable is arbitrary value, actual value we care about is value itself (if key === value that doesn't matter though)
Thats perfect. But at the moment if you put null/undefined to the observable , you will get some stuff like ä
as the output. Yeah, okay, and what is ä
? What are other symbols? You don't know it at all from the output. Just debug.
Okay, so now the library works perfectly only with numbers and values which are 1-literal strings.
The test:
it('testcase', () => {
const {hot, e, s, getMessages, flush} = rxSandbox.create();
const values = { a: undefined };
const source = hot('aaaaaaaaa|', values);
const expected = e('---x--yf---|', values);
const messages = getMessages(source.pipe(mapTo(undefined)));
flush();
marbleAssert(messages).to.equal(expected);
});
Output:
Error:
"Source: äḅċḋëḟġḧï|"
"Expected: ---x--yf---|"
It is simple observable which emits undefined
N times. Cool. And we got äḅċḋëḟġḧï|
as output. Well, that makes sense. Developer experience.
Main design comes...
Values in the observables in test are not random. You write test, you pass test data, you know what values you will pass and what values are expected. That is how unit testing works.
Even some kind of fn as value
can be passed, when you will determine symbol based on some logic (complex objects, you can use type guards).
from rx-sandbox.
Related Issues (20)
- Incompatibility with RxJS 7.8.1 HOT 4
- An in-range update of ts-jest is breaking the build 🚨 HOT 2
- Broken character encoding on console, wrong source string HOT 1
- An in-range update of lint-staged is breaking the build 🚨 HOT 1
- An in-range update of ts-jest is breaking the build 🚨 HOT 1
- An in-range update of jest-spin-reporter is breaking the build 🚨 HOT 1
- An in-range update of ts-jest is breaking the build 🚨 HOT 2
- An in-range update of husky is breaking the build 🚨 HOT 1
- An in-range update of husky is breaking the build 🚨 HOT 1
- An in-range update of commitizen is breaking the build 🚨 HOT 1
- An in-range update of @types/jest is breaking the build 🚨 HOT 4
- An in-range update of husky is breaking the build 🚨 HOT 2
- An in-range update of @commitlint/cli is breaking the build 🚨 HOT 2
- An in-range update of ts-jest is breaking the build 🚨 HOT 1
- Error when testing an observable with null emissions HOT 1
- An in-range update of lint-staged is breaking the build 🚨 HOT 4
- Release allow `undefined` as token value. HOT 3
- Jest matcher import is breaking webpack projects. HOT 11
- Jest matcher utils dependency upgrade HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rx-sandbox.