@@ -28,12 +28,8 @@ describe('configuration API', () => {
28
28
29
29
describe ( 'configure' , ( ) => {
30
30
test ( 'merges a delta rather than replacing the whole config' , ( ) => {
31
- configure ( { newKey : 123 } )
32
31
const conf = getConfig ( )
33
- expect ( conf ) . toMatchObject ( {
34
- newKey : 123 ,
35
- testIdAttribute : 'data-testid' ,
36
- } )
32
+ expect ( conf ) . toMatchObject ( { testIdAttribute : 'data-testid' } )
37
33
} )
38
34
39
35
test ( 'overrides existing values' , ( ) => {
@@ -45,15 +41,14 @@ describe('configuration API', () => {
45
41
test ( 'passes existing config out to config function' , ( ) => {
46
42
// Create a new config key based on the value of an existing one
47
43
configure ( existingConfig => ( {
48
- newKey : `${ existingConfig . testIdAttribute } -derived` ,
44
+ testIdAttribute : `${ existingConfig . testIdAttribute } -derived` ,
49
45
} ) )
50
46
const conf = getConfig ( )
51
47
52
48
// The new value should be there, and existing values should be
53
49
// untouched
54
50
expect ( conf ) . toMatchObject ( {
55
- testIdAttribute : 'data-testid' ,
56
- newKey : 'data-testid-derived' ,
51
+ testIdAttribute : 'data-testid-derived' ,
57
52
} )
58
53
} )
59
54
} )
0 commit comments