File tree 2 files changed +15
-17
lines changed
2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,9 @@ canReflect.assignMap(fixture, {
68
68
} ) ;
69
69
70
70
if ( typeof window !== "undefined" && typeof require . resolve !== "function" ) {
71
- // window.fixture = fixture;
72
71
73
72
window . fixture = function ( ) {
74
- debugger
75
- canDev . warn ( "You using the global fixture. Make sure you import can-fixture." ) ;
73
+ canDev . warn ( "You are using the global fixture. Make sure you import can-fixture." ) ;
76
74
77
75
return fixture . apply ( this , arguments ) ;
78
76
} ;
Original file line number Diff line number Diff line change @@ -1958,6 +1958,20 @@ if ("onabort" in XMLHttpRequest._XHR.prototype) {
1958
1958
xhr . send ( ) ;
1959
1959
} ) ;
1960
1960
1961
+ testHelpers . dev . devOnlyTest ( "window.fixture warns when called" , function ( ) {
1962
+ var teardown = testHelpers . dev . willWarn ( / Y o u a r e u s i n g t h e g l o b a l f i x t u r e \. M a k e s u r e y o u i m p o r t c a n - f i x t u r e \. / , function ( message , matched ) {
1963
+ if ( matched ) {
1964
+ ok ( true , "received warning" ) ;
1965
+ }
1966
+ } ) ;
1967
+
1968
+ window . fixture ( "GET /api/products" , function ( ) {
1969
+ return { } ;
1970
+ } ) ;
1971
+
1972
+ teardown ( ) ;
1973
+ } ) ;
1974
+
1961
1975
testHelpers . dev . devOnlyTest ( "Works with steal-clone" , function ( ) {
1962
1976
steal . loader . import ( "steal-clone" , { name : "can-fixture" } )
1963
1977
. then ( function ( clone ) {
@@ -1983,17 +1997,3 @@ if ("onabort" in XMLHttpRequest._XHR.prototype) {
1983
1997
1984
1998
1985
1999
1986
- testHelpers . dev . devOnlyTest ( "window.fixture warns when called" , function ( ) {
1987
- debugger
1988
- var teardown = testHelpers . dev . willWarn ( / Y o u u s i n g t h e g l o b a l f i x t u r e \. M a k e s u r e y o u i m p o r t c a n - f i x t u r e \. / , function ( message , matched ) {
1989
- if ( matched ) {
1990
- ok ( true , "received warning" ) ;
1991
- }
1992
- } ) ;
1993
-
1994
- window . fixture ( "GET /api/products" , function ( ) {
1995
- return { } ;
1996
- } ) ;
1997
-
1998
- teardown ( ) ;
1999
- } ) ;
You can’t perform that action at this time.
0 commit comments