all files / src/ experiment.js

100% Statements 67/67
100% Branches 45/45
100% Functions 13/13
100% Lines 7/7
13 statements, 20 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                      13×    
import BaseExperiment from './base-experiment';
import BehaviourNotUniqueError from './errors/behaviour-not-unique-error';
import RandomProvider from './random-provider';
import DateTimeProvider from './datetime-provider';
 
export default class Experiment extends BaseExperiment {
    constructor(name) {
        super(name || "Experiment", new RandomProvider(), new DateTimeProvider());
    }
 
    use(controlIn) {
        if (this.Control !== null) {
            throw new BehaviourNotUniqueError(this, "Control");
        }
 
        this.Control = controlIn;
    }
 
    try(candidateIn) {
        this.Candidate = candidateIn;
    }
 
    run() {
        //console.log('[EXPERIMENT] run');
        return super.run();
    }
}