1- import * as assert from 'assert' ;
2- import * as vscode from 'vscode' ;
3- import * as myExtension from '../src/copy-github-url' ;
1+ import * as assert from "assert" ;
2+ import * as myExtension from "../src/copy-github-url" ;
43
54suite ( "copyGithubUR" , ( ) => {
65
@@ -9,19 +8,19 @@ suite("copyGithubUR", () => {
98origin git@github.com:t-mrt/copy-github-url.git (fetch)
109origin git@github.com:t-mrt/copy-github-url.git (push)
11107332779b314e5aed7496bbacda35514655ef6399
12- `
11+ ` ;
1312 let message ;
1413
1514 myExtension . copyGithubURL ( {
16- execGitCommand : ( rootDir : string ) => { return stdout } ,
17- copy : ( url : string ) => { } ,
18- rootDir : "/User/test/test" ,
15+ copy : ( ) => { return ; } ,
16+ execGitCommand : ( ) => stdout ,
1917 filePath : "test/test/test.pl" ,
2018 line : {
19+ end : 5 ,
2120 start : 2 ,
22- end : 5
2321 } ,
24- showInformationMessage : ( m : string ) => { message = m }
22+ rootDir : "/User/test/test" ,
23+ showInformationMessage : ( m : string ) => { message = m ; } ,
2524 } ) ;
2625 assert . equal ( "copy! https://github.com/t-mrt/copy-github-url/blob/7332779b314e5aed7496bbacda35514655ef6399/test/test/test.pl/#L2-L5" , message ) ;
2726 } ) ;
@@ -32,59 +31,57 @@ suite("buildGithubURL", () => {
3231 test ( "multi line" , ( ) => {
3332
3433 assert . equal ( "https://github.com/t-mrt/copy-github-url/blob/7332779b314e5aed7496bbacda35514655ef6399//t/test.t/#L2-L3" , myExtension . buildGithubURL ( {
35- domain : "github.com" ,
3634 commit : "7332779b314e5aed7496bbacda35514655ef6399" ,
37- repository : "t-mrt/copy- github-url " ,
35+ domain : "github.com " ,
3836 filePath : "/t/test.t" ,
39- line : { start : 2 , end : 3 }
37+ line : {
38+ end : 3 ,
39+ start : 2 ,
40+ } ,
41+ repository : "t-mrt/copy-github-url" ,
4042 } ) ) ;
4143 } ) ;
4244
4345 test ( "single line" , ( ) => {
4446
45-
4647 assert . equal ( "https://github.com/t-mrt/copy-github-url/blob/7332779b314e5aed7496bbacda35514655ef6399//t/test.t/#L2" , myExtension . buildGithubURL ( {
47- domain : "github.com" ,
4848 commit : "7332779b314e5aed7496bbacda35514655ef6399" ,
49- repository : "t-mrt/copy- github-url " ,
49+ domain : "github.com " ,
5050 filePath : "/t/test.t" ,
51- line : { start : 2 , end : 2 }
51+ line : { start : 2 , end : 2 } ,
52+ repository : "t-mrt/copy-github-url" ,
5253 } ) ) ;
53-
5454 } ) ;
55-
5655} ) ;
5756
58-
5957suite ( "parseGitRemoteStdout" , ( ) => {
6058
6159 test ( "git protocol" , ( ) => {
6260 assert . deepEqual ( {
63- domain : ' github.com' ,
64- repository : ' t-mrt/gocha' ,
61+ domain : " github.com" ,
62+ repository : " t-mrt/gocha" ,
6563 sha1 : "54c5e13a35ea88bd914284b99254e32afb34672d" ,
6664 } , myExtension . parseStdout ( `
6765origin git@github.com:t-mrt/gocha.git (fetch)
6866origin git@github.com:t-mrt/gocha.git (push)
696754c5e13a35ea88bd914284b99254e32afb34672d
7068` ) ) ;
7169
72- assert . equal ( null , myExtension . parseStdout ( '' ) ) ;
70+ assert . equal ( null , myExtension . parseStdout ( "" ) ) ;
7371 } ) ;
7472
75- test ( "https protocol" , ( ) => {
73+ test ( "https protocol" , ( ) => {
7674 assert . deepEqual ( {
77- domain : ' github.com' ,
78- repository : ' t-mrt/gocha' ,
75+ domain : " github.com" ,
76+ repository : " t-mrt/gocha" ,
7977 sha1 : "54c5e13a35ea88bd914284b99254e32afb34672d" ,
8078 } , myExtension . parseStdout ( `
8179origin https://github.com/t-mrt/gocha.git (fetch)
8280origin https://github.com/t-mrt/gocha.git (push)
838154c5e13a35ea88bd914284b99254e32afb34672d
8482` ) ) ;
8583
86- assert . equal ( null , myExtension . parseStdout ( '' ) ) ;
84+ assert . equal ( null , myExtension . parseStdout ( "" ) ) ;
8785 } ) ;
8886
89-
90- } ) ;
87+ } ) ;
0 commit comments