(log, expected, done)
| 20 | } |
| 21 | |
| 22 | function trainWithLogAsync(log, expected, done) { |
| 23 | let net = new brain.NeuralNetwork(); |
| 24 | net |
| 25 | .trainAsync( |
| 26 | [ {input: [0], output: [0]} ], |
| 27 | { log: log, logPeriod: 1, iterations: 1 } |
| 28 | ) |
| 29 | .then(res => { |
| 30 | assert.equal(logCalled, expected); |
| 31 | done(); |
| 32 | }) |
| 33 | .catch(err => { assert.ok(false, err.toString()) }); |
| 34 | } |
| 35 | |
| 36 | it('should call log method', () => { trainWithLog(logFunction, true); }); |
| 37 | it('should not call log method', () => { trainWithLog(false, false); }); |
nothing calls this directly
no test coverage detected