Skip to content

Commit

Permalink
[CIVIC-1947] Added jest tests. Removed some storybook utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-cole committed Dec 4, 2024
1 parent 14e74e2 commit 94cf62b
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 860 deletions.
4 changes: 3 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ if (config.cli) {
scripts.forEach((script, idx) => {
const child = spawn('npm', ['run', script])
child.stdout.on('data', (data) => {
process.stdout.write(`\x1b[3${Math.min(idx, 3) + 3}m${data}`)
const color = `\x1b[3${Math.min(idx, 3) + 3}m`
const sData = data.toString().replaceAll(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '') // strip ANSI colours
process.stdout.write(`${color}${sData}`)
});
});
}
3 changes: 2 additions & 1 deletion components/00-base/grid/grid.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import each from 'jest-each';
import jestEach from 'jest-each';
const each = jestEach.default;

const template = 'components/00-base/grid/grid.twig';

Expand Down
1 change: 1 addition & 0 deletions components/00-base/storybook/storybook.docs.utils.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { decoratorDocs } from './storybook.docs.utils';
import { jest } from '@jest/globals';

describe('decoratorDocs', () => {
const mockContent = jest.fn(() => '<div>Content</div>');
Expand Down
79 changes: 0 additions & 79 deletions components/00-base/storybook/storybook.generators.utils.js

This file was deleted.

132 changes: 0 additions & 132 deletions components/00-base/storybook/storybook.generators.utils.test.js

This file was deleted.

Loading

0 comments on commit 94cf62b

Please sign in to comment.