Backend template with Core SDK and Web API.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

17 строки
455 B

  1. import { describe, it, expect } from 'vitest';
  2. import { add } from '../src';
  3. describe('core', () => {
  4. it('returns result', () => {
  5. expect(add({ a: 1, b: 1 })).toEqual(2);
  6. });
  7. it('throws when given invalid argument types', () => {
  8. expect(() => add({ a: '1' as unknown as number, b: 1 })).toThrow(TypeError);
  9. });
  10. it('throws when given out-of-range arguments', () => {
  11. expect(() => add({ a: Infinity, b: 1 })).toThrow(RangeError);
  12. });
  13. });