UNPKG

ractive

Version:

Next-generation DOM manipulation

23 lines (15 loc) 484 B
define([ 'utils/normaliseKeypath' ], function ( normaliseKeypath ) { 'use strict'; return function () { module( 'normaliseKeypath.js'); test( 'Regular keypath', function ( t ) { t.equal( normaliseKeypath( 'foo.bar' ), 'foo.bar' ); }); test( 'Keypath with array notation', function ( t ) { t.equal( normaliseKeypath( 'foo[1]' ), 'foo.1' ); }); test( 'Keypath with leading dot', function ( t ) { t.equal( normaliseKeypath( '.foo' ), 'foo' ); }); }; });