Skip to content

Commit

Permalink
Fix Test
Browse files Browse the repository at this point in the history
- Removed debugger statements
- Swapped fixture to come before steal clone test
#165 (review)
  • Loading branch information
amechi101 committed Apr 15, 2019
1 parent 6147d97 commit 98feac8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
4 changes: 1 addition & 3 deletions fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
28 changes: 14 additions & 14 deletions test/fixture_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
});

0 comments on commit 98feac8

Please sign in to comment.