Page MenuHomeSealhub

insert_nbsp.test.ts
No OneTemporary

insert_nbsp.test.ts

import assert from "assert";
import { insert_nbsp } from "./insert_nbsp.js";
describe("create non braking space util", () => {
it("should replace space for one letter word with non braking space", async () => {
const example = "Taki o to przykład!";
assert.strictEqual(insert_nbsp(example), "Taki o to przykład!");
});
it("should keep original copy if there isn't any one letter word", async () => {
const example = "Uwaga przykład!";
assert.strictEqual(insert_nbsp(example), example);
});
it("shold find one letter word on first position", async () => {
const example = "O taką Polskę walczyłem";
assert.strictEqual(
insert_nbsp(example),
"O taką Polskę walczyłem"
);
});
});

File Metadata

Mime Type
text/x-java
Expires
Tue, Jul 8, 08:34 (7 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
774659
Default Alt Text
insert_nbsp.test.ts (728 B)

Event Timeline