Skip to content

Commit

Permalink
Fix tests of ansi wasm module
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAstafyev committed Mar 22, 2024
1 parent 32f549a commit 00e0424
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions application/apps/rustcore/wasm-bindings/spec/ansi.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

describe('test', function () {
let wasm: typeof import('../pkg');

Expand All @@ -10,7 +9,9 @@ describe('test', function () {
const { convert } = wasm;
const input = '<h1> \x1b[1m Hello \x1b[31m world! </h1>';
const result = convert(input);
expect(result).toBe("<h1> <b> Hello <span style='color:#a00'> world! </h1></span></b>");
expect(result).toBe(
"&lt;h1&gt; <b> Hello <span style='color:var(--red,#a00)'> world! &lt;/h1&gt;</span></b>",
);
done();
});

Expand Down
2 changes: 1 addition & 1 deletion application/apps/rustcore/wasm-bindings/src/ansi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn converting() {
convert("<h1> \x1b[1m Hello \x1b[31m world! </h1>")
.expect("Input string should be converted as well")
.as_str(),
"<h1> <b> Hello <span style='color:#a00'> world! </h1></span></b>"
"&lt;h1&gt; <b> Hello <span style='color:var(--red,#a00)'> world! &lt;/h1&gt;</span></b>"
);
}

Expand Down

0 comments on commit 00e0424

Please sign in to comment.