You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(()=>calculateDefaultMemoryFromExpression('10 - 10',emptyContext)).toThrow(`Calculated memory value must be a positive number, greater than 0, got: 0`);
137
133
});
138
134
139
-
it('should return undefined for a negative result',()=>{
135
+
it('should throw error if result is negative',()=>{
140
136
expect(()=>calculateDefaultMemoryFromExpression('5 - 10',emptyContext)).toThrow(`Calculated memory value must be a positive number, greater than 0, got: -5`);
141
137
});
142
138
143
-
it('should return undefined for a NaN result',()=>{
139
+
it('should throw error if result is NaN',()=>{
144
140
expect(()=>calculateDefaultMemoryFromExpression('0 / 0',emptyContext)).toThrow('Failed to round number to a power of 2.');
145
141
});
146
142
147
-
it('should return undefined for a non-numeric (string) result',()=>{
143
+
it('should throw error if result is a non-numeric (string)',()=>{
148
144
expect(()=>calculateDefaultMemoryFromExpression("'hello'",emptyContext)).toThrow('Failed to round number to a power of 2.');
149
145
});
150
146
151
-
it('should return undefined for a non-numeric (object) result',()=>{
152
-
expect(()=>calculateDefaultMemoryFromExpression('{ a: 1, b: 2 }',emptyContext)).toThrow('Failed to round number to a power of 2.');
153
-
});
154
-
155
-
it('should return error when disabled functionality of MathJS is used',()=>{
147
+
it('should throw error when disabled functionality of MathJS is used',()=>{
156
148
expect(()=>calculateDefaultMemoryFromExpression('evaluate(512)',emptyContext)).toThrow('Function evaluate is disabled');
0 commit comments