Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Add descriptions for dynamic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-G committed Sep 26, 2017
1 parent 6029fb7 commit c7db284
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion test/unit/helpers/wsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('handshake', function () {
height: 1
};

describe('schema', function () {
describe('schema dynamic tests: handshake wsApi', function () {

var schemaDynamicTests = new SchemaDynamicTests({
customArgumentAssertion: function (input, expectedType, err) {
Expand All @@ -110,22 +110,27 @@ describe('handshake', function () {
schemaDynamicTests.schema.shouldFailAgainst.nonObject.arguments(handshake);

describe('nonce', function () {

schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'nonce');
});

describe('height', function () {

schemaDynamicTests.schema.shouldFailAgainst.nonInteger.property(handshake, validHeaders, 'height');
});

describe('nethash', function () {

schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'nethash');
});

describe('version', function () {

schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'version');
});

describe('required properties', function () {

schemaDynamicTests.schema.shouldFailWithoutRequiredProperties(handshake, validHeaders, ['port', 'version', 'nonce', 'nethash', 'height']);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require('./helpers/wsApi');
require('./helpers/z_schema');

require('./logic/account');
require('./logic/delegate');
require('./logic/peer');
require('./logic/peers');
require('./logic/multisignature');
Expand All @@ -39,5 +40,4 @@ require('./schema/delegates');
// with long timeouts
require('./helpers/pg-notify');
require('./logic/blockReward');
require('./logic/delegate');
require('./sql/blockRewards');
8 changes: 6 additions & 2 deletions test/unit/logic/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,14 @@ describe('delegate', function () {
});

after(function () {
describe('schema dynamic tests', function () {
describe('schema dynamic tests: delegate', function () {

schemaDynamicTest.schema.shouldFailAgainst.nonObject.property(delegate.objectNormalize, trs, 'asset.delegate');

schemaDynamicTest.schema.shouldFailAgainst.nonString.property(delegate.objectNormalize, trs, 'asset.delegate.username');
describe('username', function () {

schemaDynamicTest.schema.shouldFailAgainst.nonString.property(delegate.objectNormalize, trs, 'asset.delegate.username');
});
});
});

Expand Down

0 comments on commit c7db284

Please sign in to comment.