fix to work in browser

run unit tests and integration tests in PhantomJS
add JUnit reporter to unit test so CircleCI can show results
This commit is contained in:
Ivan Tivonenko
2015-12-23 23:49:52 +02:00
parent 896bf48c79
commit dc03c6e0ac
19 changed files with 392 additions and 17 deletions

View File

@@ -16,6 +16,8 @@ const ledgerClosed = require('./fixtures/rippled/ledger-close-newer');
const schemaValidator = RippleAPI._PRIVATE.schemaValidator;
assert.options.strict = true;
const TIMEOUT = 10000; // how long before each test case times out
function unused() {
}
@@ -37,6 +39,7 @@ function checkResult(expected, schemaName, response) {
describe('RippleAPI', function() {
this.timeout(TIMEOUT);
const instructions = {maxLedgerVersionOffset: 100};
beforeEach(setupAPI.setup);
afterEach(setupAPI.teardown);
@@ -944,7 +947,11 @@ describe('RippleAPI', function() {
});
it('getServerInfo - error', function() {
this.mockRippled.returnErrorOnServerInfo = true;
this.api.connection._send(JSON.stringify({
command: 'config',
data: {returnErrorOnServerInfo: true}
}));
return this.api.getServerInfo().then(() => {
assert(false, 'Should throw NetworkError');
}).catch(error => {