can-fixture
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -7,2 +7,3 @@ "use strict"; | ||
var canReflect = require("can-reflect"); | ||
var canDev = require("can-log/dev/dev"); | ||
var ns = require("can-namespace"); | ||
@@ -71,3 +72,8 @@ // HELPERS START | ||
if(typeof window !== "undefined" && typeof require.resolve !== "function") { | ||
window.fixture = fixture; | ||
window.fixture = function(){ | ||
canDev.warn("You are using the global fixture. Make sure you import can-fixture."); | ||
return fixture.apply(this, arguments); | ||
}; | ||
} | ||
@@ -74,0 +80,0 @@ |
{ | ||
"name": "can-fixture", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "Intercept AJAX requests and simulate responses.", | ||
@@ -5,0 +5,0 @@ "main": "fixture.js", |
@@ -1977,2 +1977,16 @@ require("./matches-test"); | ||
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() { | ||
@@ -2000,1 +2014,4 @@ steal.loader.import("steal-clone", { name: "can-fixture" }) | ||
} // END onabort check | ||
141554
3215