Fakultas Ilmu Komputer UI

Commit b5dee798 authored by rani's avatar rani
Browse files

add test for Github link validation

parent 00bd2cf1
Pipeline #26676 passed with stages
in 7 minutes and 45 seconds
import { isFromGithubLinkValid } from "../Utils";
var assert = require('assert');
describe('isFromGithubLinkValid', function () {
it('should return nothing when param is null', function () {
assert(isFromGithubLinkValid(null) == null);
});
it('should return false when link doesnt include https://github.com', function () {
assert(isFromGithubLinkValid("https://haha.com") == false);
});
it('should return true when link include https://github.com', function () {
assert(isFromGithubLinkValid("https://github.com/ranisianipar") == true);
});
})
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment