describe('exports', () => { it('exports the correct interface', () => { assert.isObject(index); }); });
test('discovery start and stop', (done) => { client.init({ startDiscovery: false }, () => { assert.isNull(client.discoveryTimer); client.startDiscovery(); assert.isObject(client.discoveryTimer); client.stopDiscovery(); assert.isNull(client.discoveryTimer); done(); }); });
it('should not throw an error by empty objects', () => { assert.doesNotThrow(() => { let r = mergeDeep({}, {}); assert.isObject(r); assert.equal(Object.keys(r).length, 0); }); });
describe( 'resolve', function() { describe( 'props', function ( ) { it( 'should define a resolve property', function () { assert.property( webpack.config, 'resolve' ); } ); it( 'should be of type object', function () { assert.isObject( webpack.config.resolve ); } ); it( 'should contain a extensions array', function () { assert.isArray( webpack.config.resolve.extensions ); } ); } ); } );
it("isObject", () => { assert.isObject({}); assert.isObject(new Foo()); expect(() => { assert.isObject(true); }).to.throw(AssertionError, "expected true to be an object"); expect(() => { assert.isObject(Foo); }).to.throw(AssertionError, "expected [Function: Foo] to be an object"); expect(() => { assert.isObject("foo"); }).to.throw(AssertionError, "expected 'foo' to be an object"); });
it('GET/HTTPS/IP-ADDRESS', (done) => { request({ url: 'https://1.1.1.1' }, (error, resp) => { assert.isOk(true, 'got response'); assert.isUndefined(error, 'no error presented'); assert.equal(resp.statusCode, 200, 'statusCode: 200'); assert.equal(resp.status, 200, 'status: 200'); assert.isObject(resp.headers, 'Headers Object is presented'); assert.equal(resp.headers['content-type'], 'text/html', 'Correct content-type header'); done(); }); });
it('should merge two basic objects 2', () => { let r = mergeDeep({}, { key2: 'key2s' }); assert.isObject(r); assert.isNotOk(r.key1); assert.equal(r.key2, 'key2s'); });
describe( 'module', function() { describe( 'props', function ( ) { it( 'should define a module object', function () { assert.isObject( webpack.getProp('module') ); } ); it( 'should define a rules property of type array', function () { assert.isArray( webpack.getProp('module').rules ); } ); } ); } );
it('should merge two deeper objects 2', () => { let r = mergeDeep({ key1: { key11: 'key11s' } }, { key1: { key22: 'key22s' } }); assert.isObject(r); assert.equal(r.key1.key11, 'key11s'); assert.equal(r.key1.key22, 'key22s'); });
describe('Defiant', () => { describe('base object', () => { it('should contain object Defiant.util', () => { assert.isObject(Defiant.util); }); it('should contain Plugin function', () => { assert.isFunction(Defiant.Plugin); }); }); });
it('should overwrite values', () => { let r = mergeDeep({ key1: 'key1s' }, { key1: 'key22s' }); assert.isObject(r); assert.equal(r.key1, 'key22s'); });
describe( 'module : rule : css', function() { describe( 'props', function ( ) { it( 'should define a rule object', function () { assert.isObject( css ); } ); } ); } );
it('should overwrite deeper values 3', () => { let r = mergeDeep({ key1: { key11: 'key11s' } }, { key1: { key11: 'key22s' }, key2: 'key2s' }); assert.isObject(r); assert.equal(r.key1.key11, 'key22s'); assert.equal(r.key2, 'key2s'); });
it('should merge two basic objects 1', () => { let r = mergeDeep({ key1: 'key1s' }, { key2: 'key2s' }); assert.isObject(r); assert.equal(r.key1, 'key1s'); assert.equal(r.key2, 'key2s'); });
describe('exports', () => { it('exports the correct interface', () => { assert.isObject(index); }); });