Skip to content

Commit

Permalink
Dev: Include file em_javascript.js in node test
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt authored and LouisGac committed Aug 28, 2017
1 parent 8bbef3a commit 634e917
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/helpers/ExpressionCoreHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,13 @@ protected function runNode($js)
public function testNode()
{
$code = "
eval(fs.readFileSync('./test.js', {encoding: 'utf8'}));
LEMradix = ',';
LEMmode = 'survey';
// Dummy jQuery.
$ = function() {
return {
on: function() {}
}
};
// Dummy document.
document = {
getElementById: function(id) {
//console.log(id);
Expand All @@ -368,6 +372,9 @@ public function testNode()
return {value: 123};
}
}
eval(fs.readFileSync('./scripts/expressions/em_javascript.js', {encoding: 'utf8'}));
LEMradix = ',';
LEMmode = 'survey';
LEMalias2varName = {
'test': 'java563168X136X5376',
'563168X136X5376': 'java563168X136X5376'
Expand All @@ -379,18 +386,18 @@ public function testNode()
'sgqa':'563168X136X5376',
'qid':5376,
'gid':136,
'type':'Y',
'type':'N',
'default':'',
'rowdivid':'',
'onlynum':'',
'onlynum': 1,
'gseq':0,
'answers': {
'Y':'Ja',
'N':'Nei'
}
},
};
LEMval('563168X136X5376.NAOK');
LEMval('563168X136X5376.NAOK') + 1;
";
$command = sprintf(
'node -p "%s"',
Expand Down

0 comments on commit 634e917

Please sign in to comment.