Skip to content

Commit c65fe95

Browse files
committed
Added support for wallaby
1 parent 068fa7a commit c65fe95

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

src/queue/DefaultEventQueue-spec.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,36 @@ import { IEvent } from '../models/IEvent';
33
import { expect } from 'chai';
44

55
describe('DefaultEventQueue', () => {
6+
7+
let config: Configuration;
8+
9+
beforeEach(() => {
10+
config = getConfiguration();
11+
});
12+
13+
afterEach(() => {
14+
let queue = <any>config.queue;
15+
clearInterval(queue._queueTimer);
16+
config = null;
17+
});
18+
619
function getConfiguration(): Configuration {
7-
let config: Configuration = new Configuration({
20+
let result: Configuration = new Configuration({
821
apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw',
922
serverUrl: 'http://localhost:50000'
1023
});
1124

12-
expect(config.storage.getList().length).to.equal(0);
13-
return config;
25+
expect(result.storage.getList().length).to.equal(0);
26+
return result;
1427
}
1528

1629
it('should enqueue event', () => {
17-
let config: Configuration = getConfiguration();
1830
let event: IEvent = { type: 'log', reference_id: '123454321' };
1931
config.queue.enqueue(event);
2032
expect(config.storage.getList().length).to.equal(1);
2133
});
2234

2335
it('should process queue', () => {
24-
let config: Configuration = getConfiguration();
2536
let event: IEvent = { type: 'log', reference_id: '123454321' };
2637
config.queue.enqueue(event);
2738
expect(config.storage.getList().length).to.equal(1);
@@ -35,7 +46,6 @@ describe('DefaultEventQueue', () => {
3546
});
3647

3748
it('should discard event submission', () => {
38-
let config: Configuration = getConfiguration();
3949
config.queue.suspendProcessing(1, true);
4050

4151
let event: IEvent = { type: 'log', reference_id: '123454321' };
@@ -44,7 +54,6 @@ describe('DefaultEventQueue', () => {
4454
});
4555

4656
it('should suspend processing', (done) => {
47-
let config: Configuration = getConfiguration();
4857
config.queue.suspendProcessing(.0001);
4958

5059
let event: IEvent = { type: 'log', reference_id: '123454321' };

wallaby.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = function (wallaby) {
2+
3+
return {
4+
files: [
5+
'src/**/*.ts',
6+
{
7+
pattern: 'src/**/*-spec.ts',
8+
ignore: true
9+
}
10+
],
11+
12+
testFramework: 'mocha',
13+
14+
tests: [
15+
'src/**/*-spec.ts'
16+
],
17+
18+
env: {
19+
type: 'node'
20+
},
21+
22+
compilers: {
23+
'src/**/*.ts': wallaby.compilers.typeScript({ module: true })
24+
}
25+
};
26+
};

0 commit comments

Comments
 (0)