From 98feac8370d59161fdcc3da787cb9a75581f6549 Mon Sep 17 00:00:00 2001 From: amechi101 Date: Mon, 15 Apr 2019 18:21:44 -0400 Subject: [PATCH] Fix Test - Removed debugger statements - Swapped fixture to come before steal clone test https://github.com/canjs/can-fixture/pull/165#pullrequestreview-223414248 --- fixture.js | 4 +--- test/fixture_test.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 17 deletions(-) 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(); -});