Compare commits

..

1 commit

Author SHA1 Message Date
269e62cdee Update dependency @typescript-eslint/eslint-plugin to v6.18.0
Some checks failed
continuous-integration/drone/push Build is failing
2024-01-08 13:12:25 +00:00
4 changed files with 54 additions and 54 deletions

View file

@ -15,7 +15,7 @@ const sortable = [
export default async function randomBunny(subreddit: string, sortBy: string = 'hot'): Promise<IReturnResult> { export default async function randomBunny(subreddit: string, sortBy: string = 'hot'): Promise<IReturnResult> {
if (!sortable.includes(sortBy)) sortBy = 'hot'; if (!sortable.includes(sortBy)) sortBy = 'hot';
const result = await fetch(`https://reddit.com/r/${subreddit}/${sortBy}.json?limit=100`) const result = await fetch(`https://reddit.com/r/${subreddit}/${sortBy}.json`)
.then((res) => { .then((res) => {
return res; return res;
}) })

View file

@ -70,28 +70,28 @@ describe('subreddit', () => {
}, 5000); }, 5000);
test('GIVEN -s is supplied, EXPECT subreddit to be changed', async () => { test('GIVEN -s is supplied, EXPECT subreddit to be changed', async () => {
const result = await cli(['-s', 'pics'], '.'); const result = await cli(['-s', 'horses'], '.');
const subreddit = result.stdout.split('\n') const subreddit = result.stdout.split('\n')
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')! .find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
.split(' = ')[1]; .split(' = ')[1];
expect(subreddit).toBe('pics'); expect(subreddit).toBe('Horses');
}, 5000); }, 5000);
test('GIVEN --subreddit is supplied, EXPECT subreddit to be changed', async () => { test('GIVEN --subreddit is supplied, EXPECT subreddit to be changed', async () => {
const result = await cli(['--subreddit', 'pics'], '.'); const result = await cli(['--subreddit', 'horses'], '.');
const subreddit = result.stdout.split('\n') const subreddit = result.stdout.split('\n')
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')! .find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
.split(' = ')[1]; .split(' = ')[1];
expect(subreddit).toBe('pics'); expect(subreddit).toBe('Horses');
}, 5000); }, 5000);
}); });
describe('sort', () => { describe('sort', () => {
test('GIVEN --sort is not supplied, EXPECT sort to be defaulted', async () => { test('GIVEN --sort is not supplird, EXPECT sort to be defaulted', async () => {
const result = await cli(['-q'], '.'); const result = await cli(['-q'], '.');
const sortBy = result.stdout.split('\n') const sortBy = result.stdout.split('\n')

View file

@ -36,7 +36,7 @@ describe('randomBunny', () => {
expect(result.Result).toBeDefined(); expect(result.Result).toBeDefined();
expect(result.Error).toBeUndefined(); expect(result.Error).toBeUndefined();
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json');
}); });
test('GIVEN sortBy is NOT supplied, expect it to default to hot', async () => { test('GIVEN sortBy is NOT supplied, expect it to default to hot', async () => {
@ -68,7 +68,7 @@ describe('randomBunny', () => {
expect(result.Result).toBeDefined(); expect(result.Result).toBeDefined();
expect(result.Error).toBeUndefined(); expect(result.Error).toBeUndefined();
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/hot.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/hot.json');
}); });
test('GIVEN sortBy is NOT valid, expect it to default to hot', async () => { test('GIVEN sortBy is NOT valid, expect it to default to hot', async () => {
@ -100,7 +100,7 @@ describe('randomBunny', () => {
expect(result.Result).toBeDefined(); expect(result.Result).toBeDefined();
expect(result.Error).toBeUndefined(); expect(result.Error).toBeUndefined();
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/hot.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/hot.json');
}); });
test('GIVEN the fetch fails, EXPECT failure result', async () => { test('GIVEN the fetch fails, EXPECT failure result', async () => {
@ -115,7 +115,7 @@ describe('randomBunny', () => {
expect(result.Error!.Code).toBe(ErrorCode.FailedToFetchReddit); expect(result.Error!.Code).toBe(ErrorCode.FailedToFetchReddit);
expect(result.Error!.Message).toBe(ErrorMessages.FailedToFetchReddit); expect(result.Error!.Message).toBe(ErrorMessages.FailedToFetchReddit);
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json');
}); });
test('GIVEN the result is NOT valid JSON, EXPECT failure result', async () => { test('GIVEN the result is NOT valid JSON, EXPECT failure result', async () => {
@ -132,7 +132,7 @@ describe('randomBunny', () => {
expect(result.Error!.Code).toBe(ErrorCode.UnableToParseJSON); expect(result.Error!.Code).toBe(ErrorCode.UnableToParseJSON);
expect(result.Error!.Message).toBe(ErrorMessages.UnableToParseJSON); expect(result.Error!.Message).toBe(ErrorMessages.UnableToParseJSON);
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json');
}); });
test('GIVEN randomSelect does NOT find a response, EXPECT failure result', async () => { test('GIVEN randomSelect does NOT find a response, EXPECT failure result', async () => {
@ -153,7 +153,7 @@ describe('randomBunny', () => {
expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound); expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound);
expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound); expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound);
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json');
}); });
test('GIVEN randomSelect does NOT find a valid response, EXPECT failure result', async () => { test('GIVEN randomSelect does NOT find a valid response, EXPECT failure result', async () => {
@ -188,6 +188,6 @@ describe('randomBunny', () => {
expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound); expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound);
expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound); expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound);
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100'); expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json');
}); });
}); });

View file

@ -904,15 +904,15 @@
"@types/yargs-parser" "*" "@types/yargs-parser" "*"
"@typescript-eslint/eslint-plugin@^6.0.0": "@typescript-eslint/eslint-plugin@^6.0.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.1.tgz#0df881a47da1c1a9774f39495f5f7052f86b72e0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.0.tgz#94b86f3c25b468c714a04bd490017ecec2fd3746"
integrity sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA== integrity sha512-3lqEvQUdCozi6d1mddWqd+kf8KxmGq2Plzx36BlkjuQe3rSTm/O98cLf0A4uDO+a5N1KD2SeEEl6fW97YHY+6w==
dependencies: dependencies:
"@eslint-community/regexpp" "^4.5.1" "@eslint-community/regexpp" "^4.5.1"
"@typescript-eslint/scope-manager" "6.18.1" "@typescript-eslint/scope-manager" "6.18.0"
"@typescript-eslint/type-utils" "6.18.1" "@typescript-eslint/type-utils" "6.18.0"
"@typescript-eslint/utils" "6.18.1" "@typescript-eslint/utils" "6.18.0"
"@typescript-eslint/visitor-keys" "6.18.1" "@typescript-eslint/visitor-keys" "6.18.0"
debug "^4.3.4" debug "^4.3.4"
graphemer "^1.4.0" graphemer "^1.4.0"
ignore "^5.2.4" ignore "^5.2.4"
@ -938,21 +938,21 @@
"@typescript-eslint/types" "5.62.0" "@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0"
"@typescript-eslint/scope-manager@6.18.1": "@typescript-eslint/scope-manager@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.18.1.tgz#28c31c60f6e5827996aa3560a538693cb4bd3848" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.18.0.tgz#24ca6fc1f4a2afa71122dcfca9282878687d9997"
integrity sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw== integrity sha512-o/UoDT2NgOJ2VfHpfr+KBY2ErWvCySNUIX/X7O9g8Zzt/tXdpfEU43qbNk8LVuWUT2E0ptzTWXh79i74PP0twA==
dependencies: dependencies:
"@typescript-eslint/types" "6.18.1" "@typescript-eslint/types" "6.18.0"
"@typescript-eslint/visitor-keys" "6.18.1" "@typescript-eslint/visitor-keys" "6.18.0"
"@typescript-eslint/type-utils@6.18.1": "@typescript-eslint/type-utils@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.18.1.tgz#115cf535f8b39db8301677199ce51151e2daee96" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.18.0.tgz#a492da599da5c38c70aa9ff9bfb473961b8ae663"
integrity sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q== integrity sha512-ZeMtrXnGmTcHciJN1+u2CigWEEXgy1ufoxtWcHORt5kGvpjjIlK9MUhzHm4RM8iVy6dqSaZA/6PVkX6+r+ChjQ==
dependencies: dependencies:
"@typescript-eslint/typescript-estree" "6.18.1" "@typescript-eslint/typescript-estree" "6.18.0"
"@typescript-eslint/utils" "6.18.1" "@typescript-eslint/utils" "6.18.0"
debug "^4.3.4" debug "^4.3.4"
ts-api-utils "^1.0.1" ts-api-utils "^1.0.1"
@ -961,10 +961,10 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==
"@typescript-eslint/types@6.18.1": "@typescript-eslint/types@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.18.1.tgz#91617d8080bcd99ac355d9157079970d1d49fefc" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.18.0.tgz#ffce610a1540c17cf7d8ecf2bb34b8b0e2e77101"
integrity sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw== integrity sha512-/RFVIccwkwSdW/1zeMx3hADShWbgBxBnV/qSrex6607isYjj05t36P6LyONgqdUrNLl5TYU8NIKdHUYpFvExkA==
"@typescript-eslint/typescript-estree@5.62.0": "@typescript-eslint/typescript-estree@5.62.0":
version "5.62.0" version "5.62.0"
@ -979,13 +979,13 @@
semver "^7.3.7" semver "^7.3.7"
tsutils "^3.21.0" tsutils "^3.21.0"
"@typescript-eslint/typescript-estree@6.18.1": "@typescript-eslint/typescript-estree@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.1.tgz#a12b6440175b4cbc9d09ab3c4966c6b245215ab4" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.0.tgz#1c357c3ca435c3cfa2af6b9daf45ca0bc2bb059a"
integrity sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA== integrity sha512-klNvl+Ql4NsBNGB4W9TZ2Od03lm7aGvTbs0wYaFYsplVPhr+oeXjlPZCDI4U9jgJIDK38W1FKhacCFzCC+nbIg==
dependencies: dependencies:
"@typescript-eslint/types" "6.18.1" "@typescript-eslint/types" "6.18.0"
"@typescript-eslint/visitor-keys" "6.18.1" "@typescript-eslint/visitor-keys" "6.18.0"
debug "^4.3.4" debug "^4.3.4"
globby "^11.1.0" globby "^11.1.0"
is-glob "^4.0.3" is-glob "^4.0.3"
@ -993,17 +993,17 @@
semver "^7.5.4" semver "^7.5.4"
ts-api-utils "^1.0.1" ts-api-utils "^1.0.1"
"@typescript-eslint/utils@6.18.1": "@typescript-eslint/utils@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.18.1.tgz#3451cfe2e56babb6ac657e10b6703393d4b82955" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.18.0.tgz#4d07c9c08f84b9939a1aca7aef98c8f378936142"
integrity sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ== integrity sha512-wiKKCbUeDPGaYEYQh1S580dGxJ/V9HI7K5sbGAVklyf+o5g3O+adnS4UNJajplF4e7z2q0uVBaTdT/yLb4XAVA==
dependencies: dependencies:
"@eslint-community/eslint-utils" "^4.4.0" "@eslint-community/eslint-utils" "^4.4.0"
"@types/json-schema" "^7.0.12" "@types/json-schema" "^7.0.12"
"@types/semver" "^7.5.0" "@types/semver" "^7.5.0"
"@typescript-eslint/scope-manager" "6.18.1" "@typescript-eslint/scope-manager" "6.18.0"
"@typescript-eslint/types" "6.18.1" "@typescript-eslint/types" "6.18.0"
"@typescript-eslint/typescript-estree" "6.18.1" "@typescript-eslint/typescript-estree" "6.18.0"
semver "^7.5.4" semver "^7.5.4"
"@typescript-eslint/visitor-keys@5.62.0": "@typescript-eslint/visitor-keys@5.62.0":
@ -1014,12 +1014,12 @@
"@typescript-eslint/types" "5.62.0" "@typescript-eslint/types" "5.62.0"
eslint-visitor-keys "^3.3.0" eslint-visitor-keys "^3.3.0"
"@typescript-eslint/visitor-keys@6.18.1": "@typescript-eslint/visitor-keys@6.18.0":
version "6.18.1" version "6.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.1.tgz#704d789bda2565a15475e7d22f145b8fe77443f4" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.0.tgz#3c8733737786fa6c78a347b4fa306ae7155b560f"
integrity sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA== integrity sha512-1wetAlSZpewRDb2h9p/Q8kRjdGuqdTAQbkJIOUMLug2LBLG+QOjiWoSj6/3B/hA9/tVTFFdtiKvAYoYnSRW/RA==
dependencies: dependencies:
"@typescript-eslint/types" "6.18.1" "@typescript-eslint/types" "6.18.0"
eslint-visitor-keys "^3.4.1" eslint-visitor-keys "^3.4.1"
"@ungap/structured-clone@^1.2.0": "@ungap/structured-clone@^1.2.0":