@@ -15,70 +15,70 @@ describe('Value', function () {
15
15
16
16
describe ( '#constructor()' , function ( ) {
17
17
it ( 'should parse "foo' , function ( ) {
18
- const tpl = new Value ( 'foo' , false ) as any
18
+ const tpl = new Value ( 'foo' , false )
19
19
expect ( tpl . initial ) . to . equal ( 'foo' )
20
20
expect ( tpl . filters ) . to . deep . equal ( [ ] )
21
21
} )
22
22
23
23
it ( 'should parse "foo | add"' , function ( ) {
24
- const tpl = new Value ( 'foo | add' , false ) as any
24
+ const tpl = new Value ( 'foo | add' , false )
25
25
expect ( tpl . initial ) . to . equal ( 'foo' )
26
26
expect ( tpl . filters . length ) . to . equal ( 1 )
27
27
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ ] )
28
28
} )
29
29
it ( 'should parse "foo,foo | add"' , function ( ) {
30
- const tpl = new Value ( 'foo,foo | add' , false ) as any
31
- expect ( tpl . initial ) . to . equal ( 'foo' ) as any
30
+ const tpl = new Value ( 'foo,foo | add' , false )
31
+ expect ( tpl . initial ) . to . equal ( 'foo' )
32
32
expect ( tpl . filters . length ) . to . equal ( 1 )
33
33
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ ] )
34
34
} )
35
35
it ( 'should parse "foo | add: 3, false"' , function ( ) {
36
- const tpl = new Value ( 'foo | add: 3, "foo"' , false ) as any
36
+ const tpl = new Value ( 'foo | add: 3, "foo"' , false )
37
37
expect ( tpl . initial ) . to . equal ( 'foo' )
38
38
expect ( tpl . filters . length ) . to . equal ( 1 )
39
39
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ '3' , '"foo"' ] )
40
40
} )
41
41
it ( 'should parse "foo | add: "foo" bar, 3"' , function ( ) {
42
- const tpl = new Value ( 'foo | add: "foo" bar, 3' , false ) as any
42
+ const tpl = new Value ( 'foo | add: "foo" bar, 3' , false )
43
43
expect ( tpl . initial ) . to . equal ( 'foo' )
44
44
expect ( tpl . filters . length ) . to . equal ( 1 )
45
45
expect ( tpl . filters [ 0 ] . name ) . to . eql ( 'add' )
46
46
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ '"foo"' , '3' ] )
47
47
} )
48
48
it ( 'should parse "foo | add: "|", 3' , function ( ) {
49
- const tpl = new Value ( 'foo | add: "|", 3' , false ) as any
49
+ const tpl = new Value ( 'foo | add: "|", 3' , false )
50
50
expect ( tpl . initial ) . to . equal ( 'foo' )
51
51
expect ( tpl . filters . length ) . to . equal ( 1 )
52
52
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ '"|"' , '3' ] )
53
53
} )
54
54
it ( 'should parse "foo | add: "|", 3' , function ( ) {
55
- const tpl = new Value ( 'foo | add: "|", 3' , false ) as any
55
+ const tpl = new Value ( 'foo | add: "|", 3' , false )
56
56
expect ( tpl . initial ) . to . equal ( 'foo' )
57
57
expect ( tpl . filters . length ) . to . equal ( 1 )
58
58
expect ( tpl . filters [ 0 ] . args ) . to . eql ( [ '"|"' , '3' ] )
59
59
} )
60
60
it ( 'should support arguments as named key/values' , function ( ) {
61
- const f = new Value ( 'o | foo: key1: "literal1", key2: value2' , false ) as any
61
+ const f = new Value ( 'o | foo: key1: "literal1", key2: value2' , false )
62
62
expect ( f . filters [ 0 ] . name ) . to . equal ( 'foo' )
63
63
expect ( f . filters [ 0 ] . args ) . to . eql ( [ [ 'key1' , '"literal1"' ] , [ 'key2' , 'value2' ] ] )
64
64
} )
65
65
it ( 'should support arguments as named key/values with inline literals' , function ( ) {
66
- const f = new Value ( 'o | foo: "test0", key1: "literal1", key2: value2' , false ) as any
66
+ const f = new Value ( 'o | foo: "test0", key1: "literal1", key2: value2' , false )
67
67
expect ( f . filters [ 0 ] . name ) . to . equal ( 'foo' )
68
68
expect ( f . filters [ 0 ] . args ) . to . deep . equal ( [ '"test0"' , [ 'key1' , '"literal1"' ] , [ 'key2' , 'value2' ] ] )
69
69
} )
70
70
it ( 'should support arguments as named key/values with inline values' , function ( ) {
71
- const f = new Value ( 'o | foo: test0, key1: "literal1", key2: value2' , false ) as any
71
+ const f = new Value ( 'o | foo: test0, key1: "literal1", key2: value2' , false )
72
72
expect ( f . filters [ 0 ] . name ) . to . equal ( 'foo' )
73
73
expect ( f . filters [ 0 ] . args ) . to . deep . equal ( [ 'test0' , [ 'key1' , '"literal1"' ] , [ 'key2' , 'value2' ] ] )
74
74
} )
75
75
it ( 'should support argument values named same as keys' , function ( ) {
76
- const f = new Value ( 'o | foo: a: a' , false ) as any
76
+ const f = new Value ( 'o | foo: a: a' , false )
77
77
expect ( f . filters [ 0 ] . name ) . to . equal ( 'foo' )
78
78
expect ( f . filters [ 0 ] . args ) . to . deep . equal ( [ [ 'a' , 'a' ] ] )
79
79
} )
80
80
it ( 'should support argument literals named same as keys' , function ( ) {
81
- const f = new Value ( 'o | foo: a: "a"' , false ) as any
81
+ const f = new Value ( 'o | foo: a: "a"' , false )
82
82
expect ( f . filters [ 0 ] . name ) . to . equal ( 'foo' )
83
83
expect ( f . filters [ 0 ] . args ) . to . deep . equal ( [ [ 'a' , '"a"' ] ] )
84
84
} )
0 commit comments