@@ -4,17 +4,33 @@ const expect = require('chai').expect;
44const Runtime = require ( '../../src/Runtime' ) ;
55
66describe ( 'Runtime.evaluateEquals' , function ( ) {
7- it ( 'should get matching input data ' , function ( ) {
7+ it ( 'should compare same loose equals on non-float ' , function ( ) {
88 const runtime = new Runtime ( ) ;
99
10- runtime . input = { foo : 'bar' } ;
11- expect ( runtime . getValueFromVariable ( 'foo' ) ) . to . equal ( 'bar' ) ;
10+ expect ( runtime . evaluateEquals ( 1 , true ) ) . to . be . true ;
1211 } ) ;
1312
14- it ( 'should error on missing input data ' , function ( ) {
13+ it ( 'should compare different loose equals on non-float ' , function ( ) {
1514 const runtime = new Runtime ( ) ;
1615
17- runtime . input = { } ;
18- expect ( ( ) => runtime . getValueFromVariable ( 'foo' ) ) . to . throw ( / U n s e t v a r i a b l e / ) ;
16+ expect ( runtime . evaluateEquals ( 0 , true ) ) . to . be . false ;
17+ } ) ;
18+
19+ it ( 'should compare same strict equals on non-float' , function ( ) {
20+ const runtime = new Runtime ( ) ;
21+
22+ expect ( runtime . evaluateEquals ( 'foo' , 'foo' , true ) ) . to . be . true ;
23+ } ) ;
24+
25+ it ( 'should compare different types strict equals on non-float' , function ( ) {
26+ const runtime = new Runtime ( ) ;
27+
28+ expect ( runtime . evaluateEquals ( true , 1 , true ) ) . to . be . false ;
29+ } ) ;
30+
31+ it ( 'should compare different values strict equals on non-float' , function ( ) {
32+ const runtime = new Runtime ( ) ;
33+
34+ expect ( runtime . evaluateEquals ( 'foo' , 'bar' , true ) ) . to . be . false ;
1935 } ) ;
2036} ) ;
0 commit comments