2121// SOFTWARE.
2222
2323import { expect } from 'chai' ;
24- import { applyChange , normalizePath , pathParts , valAt } from '../src/utils' ;
24+ import { applyChange , normalizePath , pathParts } from '../src/utils' ;
2525
2626describe ( 'utils' , ( ) => {
2727 describe ( '.normalizePath(path: string)' , ( ) => {
@@ -42,27 +42,6 @@ describe('utils', () => {
4242 } ) ;
4343 } ) ;
4444
45- describe ( '.valAt(source: any, path?: string): any' , ( ) => {
46- it ( 'should be null if null along any point in the path' , ( ) => {
47- expect ( valAt ( null ) ) . to . be . null ;
48- expect ( valAt ( null , '/foo' ) ) . to . be . null ;
49- expect ( valAt ( { a : { b : null } } , '/a/b/c' ) ) . to . be . null ;
50- } ) ;
51-
52- it ( 'should be null if accessing a path past a leaf value' , ( ) => {
53- expect ( valAt ( { a : 2 } , '/a/b' ) ) . to . be . null ;
54- } ) ;
55-
56- it ( 'should be the leaf value if one is present' , ( ) => {
57- expect ( valAt ( { a : { b : 23 } } , '/a/b' ) ) . to . eq ( 23 ) ;
58- expect ( valAt ( { a : { b : 23 } } , '/a' ) ) . to . deep . equal ( { b : 23 } ) ;
59- } ) ;
60-
61- it ( 'should be undefined if in unexplored territory' , ( ) => {
62- expect ( valAt ( { a : 23 } , '/b' ) ) . to . be . undefined ;
63- } ) ;
64- } ) ;
65-
6645 describe ( '.applyChange(from: any, to: any): any' , ( ) => {
6746 it ( 'should return the to value for non-object values of from and to' , ( ) => {
6847 expect ( applyChange ( { a : 'b' } , null ) ) . to . eq ( null ) ;
0 commit comments