I have been creating my Fitnesse Functions with the following syntax in JavaScript.
| import |
| logic |
|DT:logic|
|a|b|and?|
|0|0|0|
|0|1|0|
|1|0|0|
|1|1|1|
and in a JS file called logic.js
'use strict';
function logic() {}
logic.prototype.setA = function(a) {
this.a = a;
};
logic.prototype.setB = function(b) {
this.b = b;
};
logic.prototype.and = function() {
return this.a & this.b;
};
module.exports.logic = logic;
I have been wanting to use ES6 classes for my fixures. Below is an attempt...
'use strict';
class logic {
constructor() {
//
}
setA(a) {
this.a = a;
}
setB(b) {
this.b = b;
}
and() {
return this.a & this.b;
}
}
module.exports.logic = logic;
However, I get the following errors

I am a little confused because the 'class' keyword is just syntactic sugar. So, perhaps my syntax is wrong.
Has anyone been able to get ES6 classes to work? If so, what syntax are you using?
Thanks
I have been creating my Fitnesse Functions with the following syntax in JavaScript.
| import |
| logic |
|DT:logic|
|a|b|and?|
|0|0|0|
|0|1|0|
|1|0|0|
|1|1|1|
and in a JS file called logic.js
I have been wanting to use ES6 classes for my fixures. Below is an attempt...
However, I get the following errors
I am a little confused because the 'class' keyword is just syntactic sugar. So, perhaps my syntax is wrong.
Has anyone been able to get ES6 classes to work? If so, what syntax are you using?
Thanks