Skip to content

Commit

Permalink
test(logger): chanage logger tests from jest to uvu
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Feb 23, 2022
1 parent 008168f commit ff6d7c0
Show file tree
Hide file tree
Showing 4 changed files with 258 additions and 293 deletions.
10 changes: 4 additions & 6 deletions packages/logger/test/colorize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Color, OgmaSimpleType } from '@ogma/common';
import { Color } from '@ogma/common';
import { style } from '@ogma/styler';
import { match } from 'assert';
import { suite } from 'uvu';
Expand Down Expand Up @@ -40,14 +40,12 @@ DefaultImplSuite('it should still print', () => {
});
DefaultImplSuite.run();

const NoColorSuite = suite<{ noColorVal: any }>('No colors for streams that do not support them', {
noColorVal: process.env.NO_COLOR,
});
const NoColorSuite = suite('No colors for streams that do not support them');
NoColorSuite.before(() => {
process.env.NO_COLOR = 'true';
});
NoColorSuite.after(({ noColorVal }) => {
process.env.NO_COLOR = noColorVal;
NoColorSuite.after(() => {
delete process.env.NO_COLOR;
});
NoColorSuite('it should still print, just without the SGRs', () => {
is(colorize('hello', Color.BLUE, style.child({ getColorDepth: () => 1 }), true), 'hello');
Expand Down
7 changes: 5 additions & 2 deletions packages/logger/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { test } from 'uvu';
import { ok } from 'uvu/assert';
import { Ogma } from '../src';

it('should have Ogma defined as an object', () => {
expect(Ogma).toBeDefined();
test('should have the main export be defined', () => {
ok(Ogma);
});
test.run();
Loading

0 comments on commit ff6d7c0

Please sign in to comment.