Skip to content

Commit

Permalink
Fix #70 Add DLQ rebumitter tool
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Nov 21, 2019
1 parent dfe4a7f commit 69e911d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"exclude": ["src/test/**"],
"sourceMap": false,
"produce-source-map": false
"sourceMap": true,
"produce-source-map": true
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"test": "npm run lint && npm run mocha",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"mocha": "node --preserve-symlinks -r source-map-support/register node_modules/mocha/bin/_mocha --opts src/test/mocha.opts",
"cover": "npm run cleanCoverage && nyc --reporter=lcov --reporter=text-summary npm run test",
"mocha": "node -r source-map-support/register node_modules/mocha/bin/_mocha --opts src/test/mocha.opts",
"cover": "npm run cleanCoverage && nyc --reporter=html --reporter=cobertura --reporter=text-summary npm run test",
"compile": "./node_modules/.bin/tsc",
"cleanCoverage": "rm -rf .nyc_output coverage",
"cleanDist": "rm -rf dist",
Expand Down
2 changes: 1 addition & 1 deletion src/test/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ describe('index', () => {
const spy = sinon.spy(inst!.sqs, 'deleteMessageBatch');
inst!.on('message', (msg: Message) => msg.del());
inst!.start();
return wait().then(() => {
return wait(50).then(() => {
spy.should.be.calledTwice();
});
});
Expand Down
25 changes: 7 additions & 18 deletions src/test/src/resubmitter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
'use strict';

import * as proxyquire from 'proxyquire';

const uuidStub = () => {
return 'my_uuid';
};
(uuidStub as any)['@global'] = true;
const stubs = {
'uuid/v4': uuidStub,
};
// tslint:disable-next-line
const {Squiss: SquissPatched} = proxyquire('../../', stubs);

import {Resubmitter} from '../../resubmitter';
import {Resubmitter} from '../../index';
import {SQSStub} from '../stubs/SQSStub';
import {SQS} from 'aws-sdk';
import {Squiss, SQS} from '../../index';

describe('resubmitter', () => {

it('should work', () => {
const squissFrom = new SquissPatched({queueUrl: 'foo_DLQ'});
squissFrom!.sqs = new SQSStub(15, 0) as any as SQS;
const squissTo = new SquissPatched({queueUrl: 'foo'});
it('should work', function() {
this.timeout(2000000);
const squissFrom = new Squiss({queueUrl: 'foo_DLQ'});
squissFrom!.sqs = new SQSStub(2, 0) as any as SQS;
const squissTo = new Squiss({queueUrl: 'foo'});
squissTo!.sqs = new SQSStub(0, 0) as any as SQS;
const resubmitter = new Resubmitter({
limit: 1,
Expand Down

0 comments on commit 69e911d

Please sign in to comment.