Skip to content

Commit

Permalink
Merge pull request #518 from lifion/bugfix/update-eslint-rules-and-fi…
Browse files Browse the repository at this point in the history
…x-tests

Bugfix/update eslint rules and fix tests
  • Loading branch information
eaviles authored Dec 13, 2021
2 parents 96b0f13 + b645d86 commit 6fb394b
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 93 deletions.
18 changes: 17 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@
"jest/no-conditional-expect": "off",
"radar/no-identical-functions": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-for-each": "off"
"unicorn/no-array-for-each": "off",
"unicorn/prefer-object-from-entries": "off",
"no-secrets/no-secrets": ["error", {
"ignoreContent": [
"NoSuchLifecycleConfiguration",
"Kinesis_20131202.SubscribeToShard",
"ProvisionedThroughputExceededException",
"InvalidArgumentException",
"SubscribeToShardEvent",
"params.provisionedThroughput.writeCapacityUnits",
"eyJmb28iOiJiYXIsIGJhesQFxgoifQ==",
"Qk2rZuty0pO/vptdjx3KZ2hUqVM=",
"n0vR6WyiMI1VeNqoISbuIEPoMPM=",
"hoKe98qHWTKVJg\\+g8IEsdvvnrLI=",
"uM9dgBWF4OGL42Uqbr61Yyt5h58="
]
}]
},
"overrides": [
{
Expand Down
157 changes: 75 additions & 82 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/dynamodb-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function internal(instance) {
* @reject {Error} - The error details from AWS.DynamoDB with a corrected error stack.
* @returns {Promise}
* @private
*
*/
async function sdkCall(client, methodName, ...args) {
const stackObj = getStackObj(sdkCall);
Expand Down
4 changes: 2 additions & 2 deletions lib/fan-out-consumer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jest.mock('./stream', () => ({

jest.mock('./stats');

jest.useFakeTimers();
jest.useFakeTimers('legacy');

function nextTickWait() {
return new Promise((resolve) => setImmediate(resolve));
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('lib/fan-out-consumer', () => {
clearTimeout.mockReset();
setTimeout.mockReset();
jest.clearAllTimers();
jest.useFakeTimers();
jest.useFakeTimers('legacy');
});

test('the module exports the expected', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/heartbeat-manager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('lib/heartbeat-manager', () => {
const stateStore = { clearOldConsumers, registerConsumer };

beforeEach(() => {
jest.useFakeTimers();
jest.useFakeTimers('legacy');
});

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jest.mock('./stream', () => {
};
});

jest.useFakeTimers();
jest.useFakeTimers('legacy');

describe('lib/index', () => {
const options = { compression: 'LZ-UTF8', streamName: 'test-stream' };
Expand Down
2 changes: 1 addition & 1 deletion lib/lease-manager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jest.mock('./stream', () => ({
getStreamShards: jest.fn(() => Promise.resolve({}))
}));

jest.useFakeTimers();
jest.useFakeTimers('legacy');

describe('lib/lease-manager', () => {
const reconcile = jest.fn();
Expand Down
2 changes: 1 addition & 1 deletion lib/polling-consumer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.mock('./stream', () => ({
getStreamShards: () => Promise.resolve({ 'shard-0000': {} })
}));

jest.useFakeTimers();
jest.useFakeTimers('legacy');

describe('lib/polling-consumer', () => {
const getRecords = jest.fn(() =>
Expand Down
1 change: 0 additions & 1 deletion lib/s3-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function internal(instance) {
* @reject {Error} - The error details from AWS.S3 with a corrected error stack.
* @returns {Promise}
* @private
*
*/
async function sdkCall(client, methodName, ...args) {
const stackObj = getStackObj(sdkCall);
Expand Down
2 changes: 1 addition & 1 deletion lib/stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const { version } = require('../package.json');

jest.useFakeTimers();
jest.useFakeTimers('legacy');

describe('lib/stats', () => {
let getStats;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"homepage": "https://github.com/lifion/lifion-kinesis#readme",
"main": "lib/index.js",
"engines": {
"node": ">=10.0.0"
"node": ">=10.0.0 <16.10.0 || >16.13.0 <17.0.0 || >=17.0.1"
},
"scripts": {
"build-docs": "jsdoc2md -t ./templates/README.hbs ./lib/*.js > ./README.md && git add ./README.md",
Expand Down

0 comments on commit 6fb394b

Please sign in to comment.