Skip to content

Commit cc4b703

Browse files
committed
added tests
1 parent 1ad9fc0 commit cc4b703

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/index.d.ts",
77
"scripts": {
88
"build": "pnpm test && tsc",
9-
"test": "mocha",
9+
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts'",
1010
"docs": "typedoc --out docs src/index.ts --gitRevision master"
1111
},
1212
"dependencies": {

tests/parse.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { expect } from "chai";
2+
import { parseLink } from "../src/index";
3+
4+
describe("parse.ts", () => {
5+
it("Parse link correctly", async () => {
6+
const parsedLink = await parseLink({ link: "//kodik.cc/video/87051/57c572172a2ccfb23234cdaf7174b20d/720p" });
7+
expect(parsedLink.type).string("video", "param type");
8+
expect(parsedLink.quality).string("720", "param quality");
9+
expect(parsedLink.id).string("87051", "param id");
10+
expect(parsedLink.hash).string("57c572172a2ccfb23234cdaf7174b20d", "param hash");
11+
})
12+
})

0 commit comments

Comments
 (0)