@@ -4,7 +4,6 @@ var Observer = ob.Observer
44var observe = ob . observe
55var Dep = require ( 'src/observer/dep' )
66var _ = require ( 'src/util' )
7- var config = require ( 'src/config' )
87
98describe ( 'Observer' , function ( ) {
109 beforeEach ( function ( ) {
@@ -59,9 +58,6 @@ describe('Observer', function () {
5958 } )
6059
6160 it ( 'create on already observed object' , function ( ) {
62- var previousConvertAllProperties = config . convertAllProperties
63- config . convertAllProperties = true
64-
6561 // on object
6662 var obj = { }
6763 var val = 0
@@ -97,14 +93,9 @@ describe('Observer', function () {
9793 // should call underlying setter
9894 obj . a = 10
9995 expect ( val ) . toBe ( 10 )
100-
101- config . convertAllProperties = previousConvertAllProperties
10296 } )
10397
10498 it ( 'create on property with only getter' , function ( ) {
105- var previousConvertAllProperties = config . convertAllProperties
106- config . convertAllProperties = true
107-
10899 // on object
109100 var obj = { }
110101 Object . defineProperty ( obj , 'a' , {
@@ -134,14 +125,9 @@ describe('Observer', function () {
134125 obj . a = 101
135126 } catch ( e ) { }
136127 expect ( obj . a ) . toBe ( 123 )
137-
138- config . convertAllProperties = previousConvertAllProperties
139128 } )
140129
141130 it ( 'create on property with only setter' , function ( ) {
142- var previousConvertAllProperties = config . convertAllProperties
143- config . convertAllProperties = true
144-
145131 // on object
146132 var obj = { }
147133 var val = 10
@@ -168,14 +154,9 @@ describe('Observer', function () {
168154 // writes should call the set function
169155 obj . a = 100
170156 expect ( val ) . toBe ( 100 )
171-
172- config . convertAllProperties = previousConvertAllProperties
173157 } )
174158
175159 it ( 'create on property which is marked not configurable' , function ( ) {
176- var previousConvertAllProperties = config . convertAllProperties
177- config . convertAllProperties = true
178-
179160 // on object
180161 var obj = { }
181162 Object . defineProperty ( obj , 'a' , {
@@ -188,8 +169,6 @@ describe('Observer', function () {
188169 expect ( ob instanceof Observer ) . toBe ( true )
189170 expect ( ob . value ) . toBe ( obj )
190171 expect ( obj . __ob__ ) . toBe ( ob )
191-
192- config . convertAllProperties = previousConvertAllProperties
193172 } )
194173
195174 it ( 'create on array' , function ( ) {
@@ -237,9 +216,6 @@ describe('Observer', function () {
237216 } )
238217
239218 it ( 'observing object prop change on defined property' , function ( ) {
240- var previousConvertAllProperties = config . convertAllProperties
241- config . convertAllProperties = true
242-
243219 var obj = { val : 2 }
244220 Object . defineProperty ( obj , 'a' , {
245221 configurable : true ,
@@ -271,8 +247,6 @@ describe('Observer', function () {
271247 expect ( obj . val ) . toBe ( 3 ) // make sure 'setter' was called
272248 obj . val = 5
273249 expect ( obj . a ) . toBe ( 5 ) // make sure 'getter' was called
274-
275- config . convertAllProperties = previousConvertAllProperties
276250 } )
277251
278252 it ( 'observing set/delete' , function ( ) {
0 commit comments