Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chai-rx-assert

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-rx-assert - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

20

index.js

@@ -6,14 +6,14 @@ var rxAssert = require('rx-assert');

module.exports = function(chai, utils){
chai.Assertion.addChainableMethod('rxEqual', function(rawExpected) {
var actual = this._obj;
var expected = rawExpected;
if (! (rawExpected instanceof Array)) {
expected = slice.call(arguments);
}
chai.Assertion.addChainableMethod('rxEqual', function(rawExpected) {
var actual = this._obj;
var expected = rawExpected;
if (! (rawExpected instanceof Array)) {
expected = slice.call(arguments);
}
var result = rxAssert.isEqual(actual, expected);
var result = rxAssert.isEqual(actual, expected);
return this.assert(result[0], result[1]);
});
return this.assert(result[0], result[1]);
});
};
{
"name": "chai-rx-assert",
"version": "1.0.1",
"version": "1.0.2",
"description": "Plugin for the chai assert library for comparing observables in tests",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -15,22 +15,17 @@ # chai-rx-assert

it('should return messages with delay2', () => {
var scheduler = new TestScheduler();
it('should return messages with delay', () => {
var scheduler = new TestScheduler();
var xs = scheduler.createHotObservable(onNext(250, 2), onCompleted(550));
var xs = scheduler.createHotObservable(onNext(250, 2), onCompleted(550));
var results = scheduler.startScheduler(() => {
return xs.delay(100, scheduler);
});
var results = scheduler.startScheduler(() => {
return xs.delay(100, scheduler);
});
var expected = [
onNext(350, 2),
onCompleted(650)
]
expect(results.messages).to.rxEqual([onNext(350, 2), onCompleted(650)]) // assert ok
expect(results.messages).to.rxEqual([onNext(350, 2), onCompleted(650)]) // assert ok
// or without wrapping in list
// or without wrapping in list
expect(results.messages).to.rxEqual(onNext(350, 2), onCompleted(650)) // assert ok
expect(results.messages).to.rxEqual(onNext(350, 2), onCompleted(650)) // assert ok
});
```

@@ -15,17 +15,17 @@ var chai = require('chai');

describe('test rx-assert methods are present', function() {
it('check isRxEqual function is present', function() {
var rxEqual = expect(null).to.rxEqual;
expect(rxEqual).to.be.a('function');
});
it('check isRxEqual function is present', function() {
var rxEqual = expect(null).to.rxEqual;
expect(rxEqual).to.be.a('function');
});
it('isRxEqual should work when expected is list', function() {
var actual = [onNext(300, 1), onNext(400, 2)];
var expected = [onNext(300, 1), onNext(400, 2)];
expect(actual).rxEqual(expected);
});
it('isRxEqual should work when expected is list', function() {
var actual = [onNext(300, 1), onNext(400, 2)];
var expected = [onNext(300, 1), onNext(400, 2)];
expect(actual).rxEqual(expected);
});
it('isRxEqual should work when expected is arguments', function() {
var actual = [onNext(300, 1), onNext(400, 2)];
expect(actual).rxEqual(onNext(300, 1), onNext(400, 2));
});
it('isRxEqual should work when expected is arguments', function() {
var actual = [onNext(300, 1), onNext(400, 2)];
expect(actual).rxEqual(onNext(300, 1), onNext(400, 2));
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc