Skip to content

Commit

Permalink
Merge pull request #37 from canjs/landscaper/qunit2
Browse files Browse the repository at this point in the history
Landscaper: QUnit2 upgrade
  • Loading branch information
cherifGsoul committed May 24, 2019
2 parents aad7129 + 54ab932 commit 0e9b076
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
23 changes: 12 additions & 11 deletions can-define-stream-kefir_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ var poll = function poll(fn, callback, timeout, interval) {

QUnit.module('can-define-stream-kefir');

test('Stream behavior on multiple properties with merge', 8, function() {
QUnit.test('Stream behavior on multiple properties with merge', function(assert) {
assert.expect(8);

var expectedNewVal,
expectedOldVal,
Expand All @@ -48,14 +49,14 @@ test('Stream behavior on multiple properties with merge', 8, function() {

map.foo = 'foo-1';

QUnit.equal( map.baz, undefined, "read value before binding");
assert.equal( map.baz, undefined, "read value before binding");

map.on("baz", function(ev, newVal, oldVal){
QUnit.equal(newVal, expectedNewVal, caseName+ " newVal");
QUnit.equal(oldVal, expectedOldVal, caseName+ " oldVal");
assert.equal(newVal, expectedNewVal, caseName+ " newVal");
assert.equal(oldVal, expectedOldVal, caseName+ " oldVal");
});

QUnit.equal( map.baz, 'bar', "read value immediately after binding");
assert.equal( map.baz, 'bar', "read value immediately after binding");

caseName = "setting foo";
expectedOldVal = 'bar';
Expand Down Expand Up @@ -115,7 +116,7 @@ QUnit.test("Test if streams are memory safe", function(assert) {
);
});

test('Keep track of change counts on stream', function(){
QUnit.test('Keep track of change counts on stream', function(assert) {

var count;

Expand All @@ -138,7 +139,7 @@ test('Keep track of change counts on stream', function(){

//this increases the count.. should it?
me.on("fullNameChangeCount", function(ev, newVal){
QUnit.equal(newVal, count, "Count should be " + count);
assert.equal(newVal, count, "Count should be " + count);
});

count = 2;
Expand All @@ -150,7 +151,7 @@ test('Keep track of change counts on stream', function(){
});


test('Update map property based on stream value', function() {
QUnit.test('Update map property based on stream value', function(assert) {
var expected;
var Person = DefineMap.extend({
name: "string",
Expand All @@ -166,7 +167,7 @@ test('Update map property based on stream value', function() {
var me = new Person({name: "James"});

me.on("lastValidName", function(lastValid){
QUnit.equal(lastValid.target.name, expected, "Updated name to " + expected);
assert.equal(lastValid.target.name, expected, "Updated name to " + expected);
});

me.name = "JamesAtherton";
Expand All @@ -181,7 +182,7 @@ test('Update map property based on stream value', function() {

});

test('Stream on DefineList', function() {
QUnit.test('Stream on DefineList', function(assert) {
var expectedLength;

var People = DefineList.extend({});
Expand All @@ -196,7 +197,7 @@ test('Stream on DefineList', function() {
var stream = people.stream('length');

stream.onValue(function(event) {
QUnit.equal(event.args[0], expectedLength, 'List size changed');
assert.equal(event.args[0], expectedLength, 'List size changed');
});

expectedLength = 3;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"detect-cyclic-packages": "^1.1.0",
"jshint": "^2.9.1",
"steal": "^1.0.6",
"steal-qunit": "^1.0.0",
"steal-qunit": "^2.0.0",
"steal-tools": "^1.0.1",
"testee": "^0.9.0"
},
Expand Down

0 comments on commit 0e9b076

Please sign in to comment.