CLI for Oblique Strategies.
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.

32 lines
563 B

  1. import {
  2. afterAll,
  3. beforeAll,
  4. describe,
  5. expect,
  6. it, SpyInstanceFn,
  7. vi,
  8. } from 'vitest';
  9. import plain from '../plain';
  10. describe('plain', () => {
  11. let log: SpyInstanceFn<[], void>;
  12. let defaultConsole: typeof console;
  13. beforeAll(() => {
  14. defaultConsole = console;
  15. log = vi.fn();
  16. global.console = {
  17. log,
  18. } as unknown as typeof console;
  19. });
  20. afterAll(() => {
  21. global.console = defaultConsole;
  22. });
  23. it('calls the console output function', async () => {
  24. await plain()('foo');
  25. expect(log).toBeCalled();
  26. });
  27. });