Skip to content

Commit

Permalink
Merge pull request #212 from canjs/ie11-compat
Browse files Browse the repository at this point in the history
fix tests for IE11
  • Loading branch information
cherifGsoul authored Nov 8, 2018
2 parents 20ef6af + 8e217ed commit e43e84b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions can-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bindingProxy.urlDataObservable.value = hashchangeObservable;

function canRoute(url, defaults){
//!steal-remove-start
if(process.env.NODE_ENV !== 'production') {
if(typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
devLog.warn('Call route.register(url,defaults) instead of calling route(url, defaults)');
}
//!steal-remove-end
Expand Down Expand Up @@ -158,7 +158,7 @@ canReflect.assignMap(canRoute, {
deparam: routeDeparam,
map: function(data){
//!steal-remove-start
if(process.env.NODE_ENV !== 'production') {
if(typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
devLog.warn('Set route.data directly instead of calling route.map');
}
//!steal-remove-end
Expand Down Expand Up @@ -232,7 +232,7 @@ canReflect.assignMap(canRoute, {
// For debugging: the names that will be assigned to the updateChild and
// updateParent functions within can-bind
//!steal-remove-start
if (process.env.NODE_ENV !== 'production') {
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
bindingOptions.updateChildName = "can-route.updateRouteData";
bindingOptions.updateParentName = "can-route.updateUrl";
}
Expand Down
4 changes: 2 additions & 2 deletions test/define-testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<p>This is a dummy page to use<br/> for testing route goodness</p>

<!-- For the main CanJS test suite -->
<script type="text/javascript" src="../../../node_modules/steal/steal.js" main="@empty"></script>
<script type="text/javascript" src="../../../node_modules/steal/steal-with-promises.js" main="@empty"></script>

<!-- For this repo’s test suite -->
<script type="text/javascript" src="../node_modules/steal/steal.js" main="@empty"></script>
<script type="text/javascript" src="../node_modules/steal/steal-with-promises.js" main="@empty"></script>

<script>
steal.done().then(function() {
Expand Down
2 changes: 1 addition & 1 deletion test/route-define-test.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<title>can-route</title>
<script src="/node_modules/steal/steal.js" main="can-route/test/route-define-test"></script>
<script src="/node_modules/steal/steal-with-promises.js" main="can-route/test/route-define-test"></script>
<div id="qunit-fixture"></div>
5 changes: 3 additions & 2 deletions test/route-define-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ if (("onhashchange" in window)) {

if (typeof steal !== 'undefined') {

QUnit.asyncTest("canRoute.map: conflicting route values, hash should win (canjs/canjs#979)", function(){
QUnit.test("canRoute.map: conflicting route values, hash should win (canjs/canjs#979)", function(){
QUnit.stop();
mockRoute.start();


Expand Down Expand Up @@ -66,7 +67,7 @@ if (typeof steal !== 'undefined') {
equal(appState.get("id"), "5", "hash populates the appState");
equal(appState.get("section"), "home", "appState keeps its properties");
ok(canRoute.data === appState, "canRoute.data is the same as appState");

mockRoute.stop();
QUnit.start();
};
Expand Down
9 changes: 9 additions & 0 deletions test/test-without-proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require("./param-deparam-test");
require("./link-to-test");
require("./url-test");
require("./route-data-test");
require("./route-observability-test");
require("./route-define-test");
require("./route-map-test");
require("./route-register-test");
require("./route-stop-test");
2 changes: 1 addition & 1 deletion test/test.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<title>can-route</title>
<script src="../node_modules/steal/steal.js" main="can-route/test/test"></script>
<script src="../node_modules/steal/steal-with-promises.js" main="can-route/test/test"></script>
<div id="qunit-fixture"></div>
4 changes: 2 additions & 2 deletions test/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<p>This is a dummy page to use<br/> for testing route goodness</p>

<!-- For the main CanJS test suite -->
<script type="text/javascript" src="../../../node_modules/steal/steal.js" main="@empty"></script>
<script type="text/javascript" src="../../../node_modules/steal/steal-with-promises.js" main="@empty"></script>

<!-- For this repo’s test suite -->
<script type="text/javascript" src="../node_modules/steal/steal.js" main="@empty"></script>
<script type="text/javascript" src="../node_modules/steal/steal-with-promises.js" main="@empty"></script>

<script>
steal.done().then(function() {
Expand Down

0 comments on commit e43e84b

Please sign in to comment.