assert.equal(response.body["_count"], 3); assert.equal(response.body["_sizeLimit"], config.SIZE_LIMIT); assert.notEqual(response.body["_createdOn"], undefined); }); });
describe('.type', () => { it('should get a type', async () => { const channel = new BroadcastChannel( AsyncTestUtil.randomString(12), channelOptions ); const type = channel.type; assert.equal(typeof type, 'string'); assert.notEqual(type, ''); assert.equal(channel.type, channelOptions.type); channel.close(); }); });
assert.notEqual(files.indexOf('bin/www'), -1, 'should have bin/www file'); assert.notEqual(files.indexOf('app.js'), -1, 'should have app.js file'); assert.notEqual(files.indexOf('package.json'), -1, 'should have package.json file'); }); assert.notEqual(files.indexOf('.gitignore'), -1, 'should have .gitignore file'); }); assert.notEqual(files.indexOf('views/error.jade'), -1); assert.notEqual(files.indexOf('views/index.jade'), -1); assert.notEqual(files.indexOf('views/layout.jade'), -1); }); });
await AsyncTestUtil.wait(200); assert.notEqual(elector.isLeader, elector2.isLeader);
assert.notEqual(files.indexOf('bin/www'), -1); assert.notEqual(files.indexOf('app.js'), -1); assert.notEqual(files.indexOf('package.json'), -1); }); assert.notEqual(files.indexOf('views/error.hbs'), -1); assert.notEqual(files.indexOf('views/index.hbs'), -1); assert.notEqual(files.indexOf('views/layout.hbs'), -1); });
assert.notEqual(files.indexOf('bin/www'), -1); assert.notEqual(files.indexOf('app.js'), -1); assert.notEqual(files.indexOf('package.json'), -1); }); assert.notEqual(files.indexOf('views/error.jade'), -1); assert.notEqual(files.indexOf('views/index.jade'), -1); assert.notEqual(files.indexOf('views/layout.jade'), -1); });
assert.notEqual(files.indexOf('bin/www'), -1, 'should have bin/www file'); assert.notEqual(files.indexOf('app.js'), -1, 'should have app.js file'); assert.notEqual(files.indexOf('package.json'), -1, 'should have package.json file'); }); assert.notEqual(files.indexOf('views/error.ejs'), -1, 'should have views/error.ejs file'); assert.notEqual(files.indexOf('views/index.ejs'), -1, 'should have views/index.ejs file'); });
it('Should clone session during session assignment', () => { const session = new Session(); const action = new Action(); action.setSession(session); assert.notEqual(action.session(), session); });
function addTest() { console.log('test add function'); todo.deleteAll(); todo.add('Added'); assert.notEqual(todo.getCount(), 0, '1 item should exist'); assert.equal(todo.getCount(), 1, 'i item should exist'); testCompleted++; }
it('Should not authenticate the client if MIDDLEWARE_INBOUND blocks the authentication', async function () { global.localStorage.setItem('socketcluster.authToken', validSignedAuthTokenAlice); client = socketClusterClient.create(clientOptions); // The previous test authenticated us as 'alice', so that token will be passed to the server as // part of the handshake. let event = await client.listener('connect').once(); // Any token containing the username 'alice' should be blocked by the MIDDLEWARE_INBOUND middleware. // This will only affects token-based authentication, not the credentials-based login event. assert.equal(event.isAuthenticated, false); assert.notEqual(event.authError, null); assert.equal(event.authError.name, 'AuthenticateMiddlewareError'); });
describe('emoji', function() { describe('test emoji.random', function () { it('test random', function () { console.log(emoji.random()); assert.notEqual(null, emoji.random()); }); }); });
it('should render a template (doc XML 2003) and give result with replacements', function (done) { var data = { field1 : 'field_1', field2 : 'field_2' }; carbone.render('test_word_render_2003_XML.xml', data, function (err, result) { assert.equal(result.indexOf('field1'), -1); assert.equal(result.indexOf('field2'), -1); assert.notEqual(result.indexOf('field_1'), -1); assert.notEqual(result.indexOf('field_2'), -1); done(); }); });
it('Cloned session should have a different autofill', () => { const session = new Session(); session.setAutofill('a', 10); const clonedSession = session.clone(); clonedSession.setAutofill('b', 20); assert.notEqual(session, clonedSession); // autofill assert.equal(session.autofillKeys().length, 1); assert.equal(clonedSession.autofillKeys().length, 2); assert.equal(session.autofill('a'), clonedSession.autofill('a')); assert.equal(clonedSession.autofill('b'), 20); });
describe('addFormatters', function () { it('should add a formatter to the list of custom formatters', function () { carbone.addFormatters({ yesOrNo : function (d) { return d === true ? 'yes' : 'no'; } }); assert.notEqual(typeof carbone.formatters.yesOrNo, 'undefined'); assert.equal(carbone.formatters.yesOrNo(true), 'yes'); }); });
it('Cloned session should have a different arbitrary data', () => { const session = new Session(); session.set('a', 10); const clonedSession = session.clone(); clonedSession.set('b', 20); assert.notEqual(session, clonedSession); // autofill assert.equal(session.keys().length, 1); assert.equal(clonedSession.keys().length, 2); assert.equal(session.get('a'), clonedSession.get('a')); assert.equal(clonedSession.get('b'), 20); });