Sync your bookmarks across browsers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
455 B

  1. import { describe, it, expect } from 'vitest';
  2. import { add } from '../src';
  3. describe('blah', () => {
  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. });