Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit d7df623

Browse files
committed
test: use String.raw for escape characters integration test
Avoid dedent's unpredictable backslash handling by using String.raw. This ensures the test expectation accurately matches the generator's output.
1 parent edcaa75 commit d7df623

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

test/integration/ruby-tab/operators.test.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,16 @@ describe('Ruby Tab: Operators category blocks', () => {
102102
test('Ruby -> Code -> Ruby (escape characters) ', async () => {
103103
await loadUri(urlFor('/'));
104104

105-
const beforeRuby = dedent`
106-
"\\\\" + "\\\\"
105+
const ruby = String.raw`"\\" + "\\"
107106
108-
"\\\\n" + "\\\\n"
109-
`;
110-
111-
const afterRuby = dedent`
112-
"\\\\" + "\\\\"
113-
114-
"\\\\n" + "\\\\n"
115-
`;
107+
"\n" + "\n"`;
116108

117109
await clickText('Ruby', '*[@role="tab"]');
118-
await fillInRubyProgram(beforeRuby);
110+
await fillInRubyProgram(ruby);
119111
await clickText('Code', '*[@role="tab"]');
120112
await clickXpath(EDIT_MENU_XPATH);
121113
await clickText('Generate Ruby from Code');
122114
await clickText('Ruby', '*[@role="tab"]');
123-
expect(await currentRubyProgram()).toEqual(`${afterRuby}\n`);
115+
expect(await currentRubyProgram()).toEqual(`${ruby}\n`);
124116
});
125117
});

0 commit comments

Comments
 (0)