Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/update eslint rules and fix tests #518

Merged
merged 10 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
alo3y marked this conversation as resolved.
Show resolved Hide resolved
"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 @@ -107,7 +107,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": {
alo3y marked this conversation as resolved.
Show resolved Hide resolved
"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