test: add test for validLink

This commit is contained in:
Alikia2x 2024-03-31 16:26:48 +08:00
parent 1f5a36832c
commit 62a0e85554
2 changed files with 11 additions and 0 deletions

5
jest.config.js Normal file
View File

@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

6
test/validLink.test.ts Normal file
View File

@ -0,0 +1,6 @@
import {describe, expect, test} from '@jest/globals';
import validLink from "../lib/url/valid_link";
test("Plain, full URL", () => {
expect(validLink("https://example.com/about-us")).toBe(true);
});