fix: additional fixes after jest/recommanded introduction

This commit is contained in:
Peter Sanderson
2024-11-06 14:55:07 +01:00
committed by Peter Sanderson
parent e4536e2186
commit 17f74166ca
2 changed files with 7 additions and 1 deletions

View File

@@ -312,6 +312,7 @@ module.exports = {
// Jest plugin config
'jest/valid-title': 'off', // This rule does not use Typescript and produces false positives
'jest/valid-describe-callback': 'off', // This rule does not use Typescript and produces false positives
'jest/no-disabled-tests': 'off', // we still have a lot of skipped tests (WIP)
'jest/no-conditional-expect': 'off', // Todo: we shall solve this, this is bad practice
'jest/expect-expect': 'off', // Todo: we have test with no assertions, this may be legit but it needs to be checked
@@ -393,7 +394,7 @@ module.exports = {
{
files: ['packages/connect/e2e/**/*'],
rules: {
'jest/no-jasmine-globals': 'off', // Kamma tests
'jest/no-jasmine-globals': 'off', // Karma tests
},
},
],

View File

@@ -10,6 +10,11 @@ describe(getWeakRandomInt.name, () => {
});
it('returns same value when range is trivial', () => {
expect(getWeakRandomInt(0, 1)).toEqual(0);
expect(getWeakRandomInt(100, 101)).toEqual(100);
});
it('returns value in the given range', () => {
for (let i = 0; i < 10_000; i++) {
const result = getWeakRandomInt(0, 100);