72 lines
No EOL
2.7 KiB
JavaScript
72 lines
No EOL
2.7 KiB
JavaScript
import assert from 'assert';
|
|
|
|
import * as test2library from '../testlibrary.js';
|
|
|
|
describe('Testing test2library', () => {
|
|
describe("combineStrings", () => {
|
|
it("should return 'HelloWorld'", () => {
|
|
assert.equal(test2library.combineStrings("Hello", "World"), "HelloWorld");
|
|
});
|
|
it("should return 'Hello'", () => {
|
|
assert.equal(test2library.combineStrings("Hello", ""), "Hello");
|
|
});
|
|
it("should return 'World'", () => {
|
|
assert.equal(test2library.combineStrings("", "World"), "World");
|
|
});
|
|
it("should return ''", () => {
|
|
assert.equal(test2library.combineStrings("", ""), "");
|
|
});
|
|
it("should return '喵喵'", () => {
|
|
assert.equal(test2library.combineStrings("喵", "汪汪"), "喵汪汪");
|
|
});
|
|
});
|
|
describe("reverseString", () => {
|
|
it("should return 'olleH'", () => {
|
|
assert.equal(test2library.reverseString("Hello"), "olleH");
|
|
});
|
|
it("should return ''", () => {
|
|
assert.equal(test2library.reverseString(""), "");
|
|
});
|
|
it("should return '喵喵'", () => {
|
|
assert.equal(test2library.reverseString("喵汪汪"), "汪汪喵");
|
|
});
|
|
it("should return 'aibohphobia'", () => {
|
|
assert.equal(test2library.reverseString("aibohphobia"), "aibohphobia");
|
|
});
|
|
});
|
|
describe("capitalizeString", () => {
|
|
it("should return 'Hello'", () => {
|
|
assert.equal(test2library.capitalizeString("hello"), "Hello");
|
|
});
|
|
it("should return 'Hello'", () => {
|
|
assert.equal(test2library.capitalizeString("Hello"), "Hello");
|
|
});
|
|
it("should return ''", () => {
|
|
assert.equal(test2library.capitalizeString(""), "");
|
|
});
|
|
it("should return '喵'", () => {
|
|
assert.equal(test2library.capitalizeString("喵"), "喵");
|
|
});
|
|
});
|
|
describe("isPalindrome", () => {
|
|
it("should return true", () => {
|
|
assert.equal(test2library.isPalindrome("madam"), true);
|
|
});
|
|
it("should return false", () => {
|
|
assert.equal(test2library.isPalindrome("hello"), false);
|
|
});
|
|
it("should return true", () => {
|
|
assert.equal(test2library.isPalindrome(""), true);
|
|
});
|
|
it("should return true", () => {
|
|
assert.equal(test2library.isPalindrome("喵"), true);
|
|
});
|
|
it("should return true", () => {
|
|
assert.equal(test2library.isPalindrome("a"), true);
|
|
});
|
|
it("should return true", () => {
|
|
assert.equal(test2library.isPalindrome("aibohphobia"), true);
|
|
});
|
|
});
|
|
|
|
}); |