diff --git a/fixture.js b/fixture.js index c576296..0a2704a 100644 --- a/fixture.js +++ b/fixture.js @@ -68,11 +68,9 @@ canReflect.assignMap(fixture, { }); if(typeof window !== "undefined" && typeof require.resolve !== "function") { - // window.fixture = fixture; window.fixture = function(){ - debugger - canDev.warn("You using the global fixture. Make sure you import can-fixture."); + canDev.warn("You are using the global fixture. Make sure you import can-fixture."); return fixture.apply(this, arguments); }; diff --git a/test/fixture_test.js b/test/fixture_test.js index d53e983..1e34343 100644 --- a/test/fixture_test.js +++ b/test/fixture_test.js @@ -1958,6 +1958,20 @@ if ("onabort" in XMLHttpRequest._XHR.prototype) { xhr.send(); }); + testHelpers.dev.devOnlyTest("window.fixture warns when called", function() { + var teardown = testHelpers.dev.willWarn(/You are using the global fixture\. Make sure you import can-fixture\./, function(message, matched) { + if(matched) { + ok(true, "received warning"); + } + }); + + window.fixture("GET /api/products", function(){ + return {}; + }); + + teardown(); + }); + testHelpers.dev.devOnlyTest("Works with steal-clone", function() { steal.loader.import("steal-clone", { name: "can-fixture" }) .then(function(clone) { @@ -1983,17 +1997,3 @@ if ("onabort" in XMLHttpRequest._XHR.prototype) { -testHelpers.dev.devOnlyTest("window.fixture warns when called", function() { - debugger - var teardown = testHelpers.dev.willWarn(/You using the global fixture\. Make sure you import can-fixture\./, function(message, matched) { - if(matched) { - ok(true, "received warning"); - } - }); - - window.fixture("GET /api/products", function(){ - return {}; - }); - - teardown(); -});