Skip to content

Latest commit

 

History

History
59 lines (51 loc) · 1.49 KB

File metadata and controls

59 lines (51 loc) · 1.49 KB

Scoring: Basic testing

Check

For check simplification you have pre-implemented npm-scripts in package.json

Basic Scope

For each implemented test-case:

  • +6 if test case is implemented correctly
  • +3 if test case is implemented incorrectly
  • 0 if test case is not implemented

Test case is considered to be correctly implemented if:

  • Actually tests what's described in its title

Bad:

test('should return null if one of arguments is negative number', () => {
    const result = sumPositiveNumbers(2, 3);
    expect(result).toBe(5);
});

Good:

test('should return null if one of arguments is negative number', () => {
    const result = sumPositiveNumbers(1, -1);
    expect(result).toBeNull();
});
  • Doesn't break in case if we break functionality that is being tested
// isEven.ts

export const isEven = (num: number) => {
    return num % 2 === 0 ? 'Yes' : 'No';
};

Good:

test('should return "Yes" for even numbers', () => {
    const result = isEven(8);
    expect(result).toBe('Yes');
});

Bad:

test('should return "Yes" for even numbers', () => {
    const result = isEven(8);
    expect(typeof result).toBe('string');
});
  • Stable (multiple runs produce same test result)
  • Isolated (don't rely on external data/don't perform API calls)

Forfeits

  • -5 for each linter warning
  • -10 for each linter/TS compiler error
  • -30% of total task score Commits after deadline (except commits that affect only Readme.md, .gitignore, etc.)