Format tests
This commit is contained in:
parent
fb4cc4f707
commit
f17f89706a
2 changed files with 7 additions and 12 deletions
|
@ -34,33 +34,28 @@ describe("messageGenerators", () => {
|
|||
|
||||
describe("addLeadingSlash", () => {
|
||||
it("should add a leading slash if a file in a folder is sent", () => {
|
||||
const msg = fileRemovalEventToMsg({path: "sub/test.js"});
|
||||
const msg = fileRemovalEventToMsg({ path: "sub/test.js" });
|
||||
const result = (msg?.params as FileData).filename;
|
||||
|
||||
if(result && result.hasOwnProperty("filename"))
|
||||
expect(result).to.eq("/sub/test.js")
|
||||
if (result && result.hasOwnProperty("filename")) expect(result).to.eq("/sub/test.js");
|
||||
});
|
||||
});
|
||||
|
||||
describe("addLeadingSlash", () => {
|
||||
it("should not add a leading slash if a file in the root folder is sent", () => {
|
||||
const msg = fileRemovalEventToMsg({path: "test.js"});
|
||||
const msg = fileRemovalEventToMsg({ path: "test.js" });
|
||||
const result = (msg?.params as FileData).filename;
|
||||
|
||||
if(result && result.hasOwnProperty("filename"))
|
||||
expect(result).to.eq("test.js")
|
||||
if (result && result.hasOwnProperty("filename")) expect(result).to.eq("test.js");
|
||||
});
|
||||
});
|
||||
|
||||
describe("addLeadingSlash", () => {
|
||||
it("should return with one leading slash if a file in a folder is sent and file already is prefixed", () => {
|
||||
const msg = fileRemovalEventToMsg({path: "/sub/test.js"});
|
||||
const msg = fileRemovalEventToMsg({ path: "/sub/test.js" });
|
||||
const result = (msg?.params as FileData).filename;
|
||||
|
||||
if(result && result.hasOwnProperty("filename"))
|
||||
expect(result).to.eq("/sub/test.js")
|
||||
if (result && result.hasOwnProperty("filename")) expect(result).to.eq("/sub/test.js");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
|
@ -31,5 +31,5 @@ describe("messageTracker", () => {
|
|||
expect(msg0).to.eq(undefined);
|
||||
expect(msg1?.result).to.eq("testvalue1");
|
||||
expect(msg200?.result).to.eq("testvalue200");
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue