* chore: add core module test cases * chore: fix tests * chore: add code coverage report * chore: split coverage step * chore: split coverage step * Update jan-electron-linter-and-test.yml * Update jan-electron-linter-and-test.yml * Update jan-electron-linter-and-test.yml * chore: update tests * chore: add web utils test cases * chore: add restful and helper tests * chore: add tests
18 lines
630 B
TypeScript
18 lines
630 B
TypeScript
|
|
import cssVars from './jsonToCssVariables';
|
|
|
|
test('should convert nested JSON object to CSS variables', () => {
|
|
const input = { theme: { color: 'blue', font: { size: '14px', weight: 'bold' } } };
|
|
const expectedOutput = '--theme-color: blue;--theme-font-size: 14px;--theme-font-weight: bold;';
|
|
const result = cssVars(input);
|
|
expect(result).toBe(expectedOutput);
|
|
});
|
|
|
|
|
|
test('should convert simple JSON object to CSS variables', () => {
|
|
const input = { color: 'red', fontSize: '16px' };
|
|
const expectedOutput = '--color: red;--fontSize: 16px;';
|
|
const result = cssVars(input);
|
|
expect(result).toBe(expectedOutput);
|
|
});
|