@@ -4,7 +4,6 @@ var Observer = ob.Observer
4
4
var observe = ob . observe
5
5
var Dep = require ( 'src/observer/dep' )
6
6
var _ = require ( 'src/util' )
7
- var config = require ( 'src/config' )
8
7
9
8
describe ( 'Observer' , function ( ) {
10
9
beforeEach ( function ( ) {
@@ -59,9 +58,6 @@ describe('Observer', function () {
59
58
} )
60
59
61
60
it ( 'create on already observed object' , function ( ) {
62
- var previousConvertAllProperties = config . convertAllProperties
63
- config . convertAllProperties = true
64
-
65
61
// on object
66
62
var obj = { }
67
63
var val = 0
@@ -97,14 +93,9 @@ describe('Observer', function () {
97
93
// should call underlying setter
98
94
obj . a = 10
99
95
expect ( val ) . toBe ( 10 )
100
-
101
- config . convertAllProperties = previousConvertAllProperties
102
96
} )
103
97
104
98
it ( 'create on property with only getter' , function ( ) {
105
- var previousConvertAllProperties = config . convertAllProperties
106
- config . convertAllProperties = true
107
-
108
99
// on object
109
100
var obj = { }
110
101
Object . defineProperty ( obj , 'a' , {
@@ -134,14 +125,9 @@ describe('Observer', function () {
134
125
obj . a = 101
135
126
} catch ( e ) { }
136
127
expect ( obj . a ) . toBe ( 123 )
137
-
138
- config . convertAllProperties = previousConvertAllProperties
139
128
} )
140
129
141
130
it ( 'create on property with only setter' , function ( ) {
142
- var previousConvertAllProperties = config . convertAllProperties
143
- config . convertAllProperties = true
144
-
145
131
// on object
146
132
var obj = { }
147
133
var val = 10
@@ -168,8 +154,6 @@ describe('Observer', function () {
168
154
// writes should call the set function
169
155
obj . a = 100
170
156
expect ( val ) . toBe ( 100 )
171
-
172
- config . convertAllProperties = previousConvertAllProperties
173
157
} )
174
158
175
159
it ( 'create on property which is marked not configurable' , function ( ) {
@@ -232,9 +216,6 @@ describe('Observer', function () {
232
216
} )
233
217
234
218
it ( 'observing object prop change on defined property' , function ( ) {
235
- var previousConvertAllProperties = config . convertAllProperties
236
- config . convertAllProperties = true
237
-
238
219
var obj = { val : 2 }
239
220
Object . defineProperty ( obj , 'a' , {
240
221
configurable : true ,
@@ -266,8 +247,6 @@ describe('Observer', function () {
266
247
expect ( obj . val ) . toBe ( 3 ) // make sure 'setter' was called
267
248
obj . val = 5
268
249
expect ( obj . a ) . toBe ( 5 ) // make sure 'getter' was called
269
-
270
- config . convertAllProperties = previousConvertAllProperties
271
250
} )
272
251
273
252
it ( 'observing set/delete' , function ( ) {
0 commit comments