File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments