Skip to content

Commit

Permalink
add tests for sass asset extension transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
cr0ybot committed Dec 3, 2024
1 parent c4bdf3c commit 53dfcd0
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions packages/toolkit/utils/__tests__/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,51 @@ describe('transformBlockJson', () => {
),
);
});

it('transforms sass and scss to css', () => {
expect(
transformBlockJson(
JSON.stringify({
style: 'file:./style.sass',
editorStyle: 'file:./editor.scss',
viewStyle: 'file:./view.sass',
version: '12345678',
}),
absoluteteFileName,
),
).toEqual(
JSON.stringify(
{
style: 'file:./style.css',
editorStyle: 'file:./editor.css',
viewStyle: 'file:./view.css',
version: '12345678',
},
null,
2,
),
);
expect(
transformBlockJson(
JSON.stringify({
style: ['file:./style.sass', 'file:./style.scss'],
editorStyle: ['file:./editor.sass', 'file:./editor.scss'],
viewStyle: ['file:./view.sass', 'file:./view.scss'],
version: '12345678',
}),
absoluteteFileName,
),
).toEqual(
JSON.stringify(
{
style: ['file:./style.css', 'file:./style.css'],
editorStyle: ['file:./editor.css', 'file:./editor.css'],
viewStyle: ['file:./view.css', 'file:./view.css'],
version: '12345678',
},
null,
2,
),
);
});
});

0 comments on commit 53dfcd0

Please sign in to comment.