test: add space before init

This commit is contained in:
Sidharth Vinod
2023-03-31 00:18:53 +05:30
parent 48d267c6dc
commit d16894daf4

View File

@@ -29,6 +29,7 @@ graph TD
%% This is another comment %% This is another comment
%%{init: {'theme': 'forest'}}%% %%{init: {'theme': 'forest'}}%%
%%{ init: {'theme': 'space before init'}}%%
%%{init: {'theme': 'space after ending'}}%% %%{init: {'theme': 'space after ending'}}%%
graph TD graph TD
A-->B A-->B
@@ -37,17 +38,18 @@ graph TD
%% This is a comment %% This is a comment
`; `;
expect(cleanupComments(text)).toMatchInlineSnapshot(` expect(cleanupComments(text)).toMatchInlineSnapshot(`
" "
%%{init: {'theme': 'forest'}}%% %%{init: {'theme': 'forest'}}%%
%%{init: {'theme': 'space after ending'}}%% %%{ init: {'theme': 'space before init'}}%%
graph TD %%{init: {'theme': 'space after ending'}}%%
A-->B graph TD
A-->B
B-->C B-->C
" "
`); `);
}); });
it('should remove indented comments', () => { it('should remove indented comments', () => {