promised-models2
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -94,4 +94,4 @@ var Events = require('./events'), | ||
this._cacheBranches[branch] = [].concat(this._models); | ||
if (!changed) { | ||
changed = true; | ||
changed = true; | ||
if (branch === this.DEFAULT_BRANCH) { | ||
this.trigger('commit'); | ||
@@ -98,0 +98,0 @@ } |
{ | ||
"description": "promise based, typed attributes, nested models and collections", | ||
"name": "promised-models2", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"repository": "git@github.com:bem-node/promised-models.git", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -458,4 +458,18 @@ var expect = require('chai').expect; | ||
it('should correctly trigger commit event for added and changed models', function () { | ||
var triggeredCount = 0, | ||
newModel = new TestModel({a: 'a'}); | ||
collection.on('commit', function () { | ||
triggeredCount++; | ||
}); | ||
collection.add(newModel); | ||
newModel.set('a', 'aa'); | ||
collection.commit(); | ||
expect(triggeredCount).to.be.equal(2); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
176316
4567