Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global suite, test */
import chai from 'chai';
import { assert } from 'chai';
import spies from 'chai-spies';
import spiesTdd from 'chai-spies-tdd';
chai.use(spies);
chai.use(spiesTdd);
import { Rx, h } from 'cyclejs';
import equalCollection from 'chai-equal-collection';
chai.use(equalCollection(Rx.internals.isEqual));
import injectTestingUtils from '../src/inject-testing-utils';
suite('injectTestingUtils', () => {
test('should be a function', () => {
assert.isFunction(injectTestingUtils);
});
test('should throw if argument is not a function', () => {
assert.throws(() => injectTestingUtils());
assert.throws(() => injectTestingUtils({}));
assert.throws(() => injectTestingUtils([]));
});
/* global suite, test */
import chai from 'chai';
import { assert } from 'chai';
// has to be imported before Rx
import inject from 'cyclejs-mock';
import { Rx } from 'cyclejs';
import each from 'foreach';
import model from '../model';
chai.use(require('chai-equal-collection')(Rx.internals.isEqual));
suite('model', () => {
suite('API', () => {
test('Should be an object with functions as properties', () => {
assert.isObject(model);
each(model, (prop) => assert.isFunction(prop));
});
});
/* global suite, test */
import chai from 'chai';
import { assert } from 'chai';
// has to be imported before Rx
import inject from 'cyclejs-mock';
import { Rx } from 'cyclejs';
import view from '../view';
chai.use(require('chai-equal-collection')(Rx.internals.isEqual));
suite('view', () => {
suite('API', () => {
test('Should be a function', () => {
assert.isFunction(view);
});
});
suite('I/O', () => {
/* global suite, test */
import chai from 'chai';
import { assert } from 'chai';
// has to be imported before Rx
import inject from 'cyclejs-mock';
import { Rx } from 'cyclejs';
import each from 'foreach';
import intent from '../intent';
chai.use(require('chai-equal-collection')(Rx.internals.isEqual));
suite('intent', () => {
suite('API', () => {
test('Should be an object with functions as properties', () => {
assert.isObject(intent);
each(intent, (prop) => assert.isFunction(prop));
});
});