wordpos/test/validate_test.js

53 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-01-18 08:09:56 +00:00
/**
* validate_test.js
*
* Run validate on all four main index files
2016-01-18 08:09:56 +00:00
*
* Copyright (c) 2012-2016 mooster@42at.com
* https://github.com/moos/wordpos
*
* Released under MIT license
*/
var
chai = require('chai'),
assert = chai.assert,
exec = require('child_process').exec,
cmd = 'node ' + __dirname + '/../tools/validate ',
TIMEOUT_SEC = 35 * 1000,
2016-01-18 08:09:56 +00:00
gDone;
describe('validate isX() using fastIndex', function() {
this.timeout(TIMEOUT_SEC);
this.slow(1800);
2016-01-18 08:09:56 +00:00
it('should validate index.verb', function(done) {
gDone = done;
exec(cmd + 'index.verb', callback);
});
it('should validate index.adv', function(done) {
gDone = done;
exec(cmd + 'index.adv', callback);
});
it('should validate index.adj', function(done) {
gDone = done;
exec(cmd + 'index.adj', callback);
});
it('should validate index.noun', function(done) {
gDone = done;
exec(cmd + 'index.noun', callback);
});
});
function callback(error, stdout, stderr) {
assert.isNull(error);
console.log(stdout);
console.error(stderr);
gDone();
}