Skip to content

Commit

Permalink
Update test for IE
Browse files Browse the repository at this point in the history
Functions don't have a name property in IE, we shouldn't rely on
constant strings for this. Also removed the second test which does
exactly the same thing as the first, but changes the name.
  • Loading branch information
thomaswilburn committed Sep 5, 2018
1 parent 6fabf47 commit ed22618
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions test/test-define-only.js
Expand Up @@ -1216,10 +1216,10 @@ testHelpers.dev.devOnlyTest("Setting a value with only a get() generates a warni
QUnit.equal(finishErrorCheck(), 1);
});

testHelpers.dev.devOnlyTest("warn on using a Constructor for small-t type definintions", function() {
QUnit.expect(2);
testHelpers.dev.devOnlyTest("warn on using a Constructor for small-t type definitions", function() {
QUnit.expect(1);

var message = 'can-define: the definition for VM{}.currency uses a constructor for "type". Did you mean "Type"?';
var message = /can-define: the definition for [\w{}\.]+ uses a constructor for "type"\. Did you mean "Type"\?/;
var finishErrorCheck = testHelpers.dev.willWarn(message);

function Currency() {
Expand All @@ -1241,21 +1241,6 @@ testHelpers.dev.devOnlyTest("warn on using a Constructor for small-t type defini

QUnit.equal(finishErrorCheck(), 1);

message = 'can-define: the definition for VM2{}.currency uses a constructor for "type". Did you mean "Type"?';
finishErrorCheck = testHelpers.dev.willWarn(message);

function VM2() {}

define(VM2.prototype, {
currency: {
type: Currency, // should be `Type: Currency`
default: function() {
return new Currency({});
}
}
});

QUnit.equal(finishErrorCheck(), 1);
});

testHelpers.dev.devOnlyTest("warn with constructor for Value instead of Default (#340)", function() {
Expand Down

0 comments on commit ed22618

Please sign in to comment.