Esempio n. 1
0
 it('should not mutate input list', function() {
   var sorted = anysort.grouped(sortable, [before]);
   assert.notDeepEqual(sorted, sortable);
   assert.equal(sorted.length, sortable.length);
 });
Esempio n. 2
0
 it('should set a transport object', function (done) {
   Jademail.setTransport(dummyTransport);
   var transportobj = nodemailer.createTransport('SMTP', dummyTransport);
   assert.notDeepEqual(Jademail.transport, transportobj, 'Jademail transport is incorrect');
   return done();
 });
Esempio n. 3
0
 equals: function( a, b ) {
     assert.notDeepEqual( a, b );
 }
Esempio n. 4
0
 .then(function () {
   assert.notDeepEqual(cache.all(), {});
   return cache.flush();
 })
Esempio n. 5
0
 const assertStreamControllerStarted = (streamController) => {
   assert.equal(streamController.hasInterval(), true, 'StreamController should start interval');
   assert.notDeepEqual(streamController.state, State.STOPPED, 'StreamController\'s state should not be STOPPED');
 };
Esempio n. 6
0
 it('should be loaded from a .json file', function () {
   var all;
   routes.map('./test/api.json');
   all = routes.all();
   assert.notDeepEqual(all, undefined);
 });
Esempio n. 7
0
 "successfully" : function(err, resp) {
     assert.isNull(err);
     assert.equal(link.url, resp.url);
     assert.deepEqual(link.sourceObjects[0], resp.sourceObjects[0]);
     assert.notDeepEqual(link, resp);
 }
Esempio n. 8
0
 beer.prepare(ipa, function(err, preparedIpa) {
   assert.ok(!err);
   assert.notDeepEqual(ipa, preparedIpa);
   assert.deepEqual(preparedIpa, {type:'IPA', brewery:'Lervig', name:'Rye IPA'});
   done();
 });
 "the updated time stamp should be set" : function(topic) {
     assert.isNotNull(topic.updated);
     assert.instanceOf(topic.updated, Date);
     assert.notDeepEqual(topic.updated, topic.created);
     helper.dropDefaultModels();
 }
Esempio n. 10
0
 this.pricing.on('change', () => {
   assert.notDeepEqual(originalTotal, applePay.totalLineItem);
   done();
 });
Esempio n. 11
0
 numberThinger.prepare(numberThing, function(err, thingedNumber) {
   assert.ok(!err);
   assert.notDeepEqual(numberThing, thingedNumber);
   assert.ok(thingedNumber.number === 10 * 15);
   done();
 });
 return emp.save().chain(function () {
     //force reload
     assert.isNotNull(emp.updatedAt);
     assert.instanceOf(emp.updatedAt, patio.SQL.DateTime);
     assert.notDeepEqual(emp.updatedAt, emp.createdAt);
 }).classic(next);
Esempio n. 13
0
 it('should sort with matchers array', function() {
   assert.notEqual(sortable[0], matchers[0]);
   assert.equal(sortable.sort(anysort(matchers))[0], matchers[0]);
   assert.notDeepEqual(sortable, nativeSorted);
 });
Esempio n. 14
0
 it('should work as an Array.sort callback', function() {
   assert.notDeepEqual(sortable, nativeSorted);
   sortable.sort(anysort());
   assert.deepEqual(sortable, nativeSorted);
 });
Esempio n. 15
0
 it('should contain the routes from the .json file', function () {
   var all = routes.all();
   assert.notDeepEqual(all, undefined);
   assert.notDeepEqual(all['/api/test'], undefined);
 });
Esempio n. 16
0
 it('should shuffle the elements in the array in-place', function () {
   var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
   fisherYates(a);
   assert.notDeepEqual(a, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
 });
Esempio n. 17
0
 it('should filter a route', function () {
   assert.notDeepEqual(routes.get('/api/test'), undefined);
   assert.deepEqual(routes.get('/non-existing'), undefined);
 });
Esempio n. 18
0
 it("should not let changes in input propagate to output", function () {
     var obj2;
     obj2 = helpers.deepCopy(obj);
     obj.a = 2;
     assert.notDeepEqual(helpers.deepCopy(obj), obj2);
 });
Esempio n. 19
0
 it('should pass', function () {
   var arr = ['a', 'b'];
   var err = assert.notDeepEqual(arr, [1, 2]);
   if (err) throw err;
 })
Esempio n. 20
0
 callback: function (response) {
   assert.notDeepEqual(messages, response[0]);
   done();
 },
 self.tmq.db.find({},function (err, packetArray) {
   assert.equal(packetArray.length,4);
   assert.notDeepEqual(packetArray,[]);
   done();
 });
Esempio n. 22
0
var errorThrown;
try {
    assert.equal({}, {});
} catch(err) {
    errorThrown = true;
}
assert(errorThrown, 'Check assert equal on objects');

assert.deepEqual({}, {});
assert.deepEqual({value: {value: 123}}, {value: {value: '123'}}
);
assert.deepEqual([1, 2, 3], ['1', '2', '3']);


// assert.notDeepEqual() checks objects for unequality.
assert.notDeepEqual(12, 13);
assert.notDeepEqual({}, {value: 12});
assert.notDeepEqual([1, 2, 3], [2, 3, 4]);


// assert.throws() checks if a code block throws an exception.
assert.throws(function() { throw new Error('Encountered error!'); },
              Error);

assert.throws(function() { throw new Error('Encountered error!'); },
              Error, 'Check assert.throw(function() { throw new Error(\'Encountered error!\'); }, Error)');


// assert.doesNotThrow()
assert.doesNotThrow(function() { });
assert.doesNotThrow(function() { }, 'Check assert.doesNotThrow(function() { })');
Esempio n. 23
0
 it('should work as a lodash helper:', function () {
   assert.deepEqual(_.template('<%= date("mmmm dd, yyyy") %>', {}, {imports: {date: helper}}), dateformat('mmmm dd, yyyy'));
   assert.deepEqual(_.template('<%= date("mmmm") %>', {}, {imports: {date: helper}}), dateformat('mmmm'));
   assert.notDeepEqual(_.template('<%= date("mmmm dd, yyyy") %>', {}, {imports: {date: helper}}), dateformat('mmmm'));
 });
Esempio n. 24
0
test('assert.notDeepEqual', () => {
  assert.notDeepEqual({a: 1}, {a: 1});
});
 it('allows toJSON to be overridden', function(done) {
   assert.notDeepEqual(Employee.schema.get('toJSON'), Person.schema.get('toJSON'));
   assert.deepEqual(Employee.schema.get('toJSON'), { getters: false, virtuals: true });
   done();
 });
Esempio n. 26
0
const assert = require('assert');

const obj1 = {
    a: {
        b: 1
    }
};
const obj2 = {
    a: {
        b: 2
    }
};
const obj3 = {
    a: {
        b: 1
    }
};
const obj4 = Object.create(obj1);

// assert.notDeepEqual(obj1, obj1);
// 抛出 AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }

assert.notDeepEqual(obj1, obj2);
// 通过,obj1 与 obj2 不深度相等

// assert.notDeepEqual(obj1, obj3);
// 抛出 AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }

assert.notDeepEqual(obj1, obj4);
// 通过,obj1 与 obj4 不深度相等
Esempio n. 27
0
var log = bunyan.createLogger({name: "lobby-uploader"});

var configDir = "./config/";

var global = hs.keys(lconf()
		.parse(configDir + "global.json")	
		.parse(configDir + "global.yml")	
		.parse(configDir + "global.yaml")	
		.parse(configDir + "global.js")
		.suppress()
		.opts());

// verify we have global config
try {
	assert.notDeepEqual(global, {},
	"global configuration not found! see https://github.com/monum/lobby-uploader/#configuration for more info.");
} catch (e) {
	log.error({error: e, global: global}, "Failed to find global configuration.");
	throw e;
}

// does the aws preporation work
var awsPrepped = new Promise(function(resolve, reject) {
	aws.config.update({accessKeyId: global["S3_API_KEY"], secretAccessKey: global["S3_API_TOKEN"]});
	var s3 = new aws.S3();
	s3.headBucket({Bucket: global["BUCKET"]}, function(err) {
		if (err) {
			s3.createBucket({Bucket: global["BUCKET"], ACL: "public-read"}, function(err, data) {
				if (err) {
					reject({error: err});
				} else {
Esempio n. 28
0
it('should shuffle array', function () {
	assert.notDeepEqual(arrayShuffle([1, 2, 3, 4, 5, 6]), [1, 2, 3, 4, 5, 6]);
});
Esempio n. 29
0
 merge.voxelsIn(result).forEach(function(pos) {
   assert.notDeepEqual(pos, removeBlock)
   game.setBlock(pos, 2)
 })
Esempio n. 30
0
  it('should create isolated instances', function () {
    var custom = new Rules(log, {api_version: false}),
        standard = new Rules(log);

    assert.notDeepEqual(custom.rules, standard.rules);
  });