Skip to content

Commit

Permalink
refactor: improve modifiers organization (#745)
Browse files Browse the repository at this point in the history
* refactor: improve modifiers organization

* chore: unify modifiers
  • Loading branch information
wellwelwel committed Sep 7, 2024
1 parent aa25e68 commit 228177f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
3 changes: 1 addition & 2 deletions src/modules/helpers/describe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { hrtime, env } from 'node:process';
import { format } from '../../services/format.js';
import { Write } from '../../services/write.js';
import { indentation } from '../../configs/indentation.js';
import { todo } from './it/todo.js';
import { skip } from './it/skip.js';
import { todo, skip } from './modifiers.js';

async function describeCore(
title: string,
Expand Down
3 changes: 1 addition & 2 deletions src/modules/helpers/it/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { each } from '../../../configs/each.js';
import { indentation } from '../../../configs/indentation.js';
import { format } from '../../../services/format.js';
import { Write } from '../../../services/write.js';
import { todo } from './todo.js';
import { skip } from './skip.js';
import { todo, skip } from '../modifiers.js';

async function itCore(
message: string,
Expand Down
8 changes: 0 additions & 8 deletions src/modules/helpers/it/skip.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/modules/helpers/it/todo.ts

This file was deleted.

13 changes: 13 additions & 0 deletions src/modules/helpers/modifiers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Write } from '../../services/write.js';
import { indentation } from '../../configs/indentation.js';
import { format } from '../../services/format.js';

export const todo = (message: string, _cb?: () => unknown) =>
Write.log(
`${indentation.hasDescribe ? ' ' : ''}${format(`● ${message}`).cyan().bold()}`
);

export const skip = (message: string, _cb?: () => unknown) =>
Write.log(
`${indentation.hasDescribe ? ' ' : ''}${format(`◯ ${message}`).info().bold()}`
);

0 comments on commit 228177f

Please sign in to comment.