Skip to content

Commit

Permalink
Reworked tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dartvandru committed Apr 24, 2018
1 parent 9edd2a7 commit e3dd0c0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/eventuate-clients/eventuate-client-nodejs.git"
},
"scripts": {
"test": "./node_modules/.bin/mocha --reporter spec --ui bdd test/*-spec.js",
"test": "cd ./test && ../node_modules/.bin/mocha --timeout 25000 --reporter spec --ui bdd staticAPI-spec.js specialChars-spec.js Encryption-spec.js EventuateServerError-spec.js EventuateClient-spec.js EventuateClientEncryption-spec.js EventuateClientPromises-spec.js EventuateClientPromisesRetry-spec.js EventuateClientTriggeringEventToken-spec.js AckOrderTracker-spec.js stomp-spec.js subscribe-spec.js subscribeEncrypted-spec.js subscribeManyEvents-spec.js subscribeTwoSubscribers-spec.js subscribeWithOptions-spec.js AggregateRepository-spec.js AggregateRepositoryEncryption-spec.js AggregateRepositoryWithTriggeringEventToken-spec.js ObservableQueue-spec.js EventTypeSwimlaneDispatcher-spec.js",
"compile": "rm -fr dist/* && node_modules/babel-cli/bin/babel.js --presets es2015,stage-0 --plugins add-module-exports -d dist/ src/",
"build-and-test": "npm run compile && npm test"
},
Expand Down
2 changes: 1 addition & 1 deletion test/AggregateRepository-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const eventuateClient = helpers.createEventuateClient();
const aggregateRepository = new AggregateRepository({ eventuateClient, EntityClass });
const subscriptionManager = new EventuateSubscriptionManager({ eventuateClient });

const timeout = 20000;
const timeout = 25000;

let createdTimestamp;
let updateTimestamp;
Expand Down
6 changes: 3 additions & 3 deletions test/AggregateRepositoryEncryption-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const eventuateClient = createEventuateClient(encryption);
const aggregateRepository = new AggregateRepository({ eventuateClient, EntityClass });
const subscriptionManager = new EventuateSubscriptionManager({ eventuateClient });

const timeout = 20000;
const timeout = 25000;

let createdTimestamp;
let updateTimestamp;
Expand All @@ -29,7 +29,7 @@ let myEntityWasCreatedEventId;
let myEntityWasUpdatedEventId;
let version;

describe('AggregateRepository', function () {
describe('AggregateRepository with encryption', function () {
this.timeout(timeout);

it('function createEntity() should return entityAndEventInfo object', done => {
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('AggregateRepository', function () {
});
});

describe('EventuateSubscriptionManager', function () {
describe('EventuateSubscriptionManager with encryption', function () {
this.timeout(timeout);

it('should subscribe two subscribers and receive events', done => {
Expand Down
6 changes: 0 additions & 6 deletions test/ObservableQueue-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('ObservableQueue', function () {

events.forEach((event) => {
new Promise((resolve, reject) => {

queue.queueEvent({ event, resolve, reject });
});
});
Expand All @@ -52,7 +51,6 @@ describe('ObservableQueue', function () {
const stop = 3;

const eventHandler = event => {

return new Promise((resolve, reject) => {

processedEvents++;
Expand Down Expand Up @@ -80,12 +78,8 @@ describe('ObservableQueue', function () {

events.forEach((event) => {
new Promise((resolve, reject) => {

queue.queueEvent({ event, resolve, reject });
});
});


});

});
2 changes: 0 additions & 2 deletions test/subscribeWithOptions-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ describe('Subscribe with options', function () {
expect(destinationObj).to.have.property('progressNotifications');

done();

});

});
});

0 comments on commit e3dd0c0

Please sign in to comment.