Skip to content

Commit f891d60

Browse files
committed
Started tests for Runtime
1 parent 9b6efc6 commit f891d60

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
const expect = require('chai').expect;
4+
const Runtime = require('../../src/Runtime');
5+
6+
describe('Runtime.evaluateUnaryExpression', function() {
7+
it('should get matching input data', function() {
8+
const runtime = new Runtime();
9+
10+
runtime.input = { foo: 'bar' };
11+
expect(runtime.getValueFromVariable('foo')).to.equal('bar');
12+
});
13+
14+
it('should error on missing input data', function() {
15+
const runtime = new Runtime();
16+
17+
runtime.input = {};
18+
expect(() => runtime.getValueFromVariable('foo')).to.throw(/Unset variable/);
19+
});
20+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
const expect = require('chai').expect;
4+
const Runtime = require('../../src/Runtime');
5+
6+
describe('Runtime.getValueFromVariable', function() {
7+
it('should get matching input data', function() {
8+
const runtime = new Runtime();
9+
10+
runtime.input = { foo: 'bar' };
11+
expect(runtime.getValueFromVariable('foo')).to.equal('bar');
12+
});
13+
14+
it('should error on missing input data', function() {
15+
const runtime = new Runtime();
16+
17+
runtime.input = {};
18+
expect(() => runtime.getValueFromVariable('foo')).to.throw(/Unset variable/);
19+
});
20+
});

0 commit comments

Comments
 (0)