@@ -4,37 +4,38 @@ import sinon from "sinon";
4
4
import changelogFunctions from "./index.js" ;
5
5
6
6
/** @type {sinon.SinonSandbox } */
7
- let sandbox ;
7
+ let sandbox = sinon . createSandbox ( ) ;
8
8
9
9
const data = {
10
- commit : "a085003 " ,
10
+ commit : "a085003d4c8ca284c116668d7217fb747802ed85 " ,
11
11
user : "Andarist" ,
12
12
pull : 1613 ,
13
13
repo : "emotion-js/emotion" ,
14
14
} ;
15
15
16
16
test . beforeEach ( ( t ) => {
17
- sandbox = sinon . createSandbox ( ) ;
18
- const stub = sandbox . stub ( "@changesets/get-github-info" ) ;
19
- stub . getInfo . returns ( {
20
- pull : data . pull ,
21
- user : data . user ,
22
- links : {
23
- user : `[@${ data . user } ](https://github.com/${ data . user } )` ,
24
- pull : `[#${ data . pull } ](https://github.com/${ data . repo } /pull/${ data . pull } )` ,
25
- commit : `[\`${ data . commit } \`](https://github.com/${ data . repo } /commit/${ data . commit } )` ,
26
- } ,
27
- } ) ;
28
-
29
- stub . getInfoFromPullRequest . returns ( {
30
- commit : data . commit ,
31
- user : data . user ,
32
- links : {
33
- user : `[@${ data . user } ](https://github.com/${ data . user } )` ,
34
- pull : `[#${ data . pull } ](https://github.com/${ data . repo } /pull/${ data . pull } )` ,
35
- commit : `[\`${ data . commit } \`](https://github.com/${ data . repo } /commit/${ data . commit } )` ,
36
- } ,
37
- } ) ;
17
+ sandbox . stub ( {
18
+ getInfo : ( ) => ( {
19
+ pull : data . pull ,
20
+ user : data . user ,
21
+ links : {
22
+ user : `[@${ data . user } ](https://github.com/${ data . user } )` ,
23
+ pull : `[#${ data . pull } ](https://github.com/${ data . repo } /pull/${ data . pull } )` ,
24
+ commit : `[\`${ data . commit . slice ( 0 , 7 ) } \`](https://github.com/${ data . repo } /commit/${ data . commit } )` ,
25
+ } ,
26
+ } )
27
+ } , "getInfo" ) ;
28
+ sandbox . stub ( {
29
+ getInfoFromPullRequest : ( ) => ( {
30
+ commit : data . commit ,
31
+ user : data . user ,
32
+ links : {
33
+ user : `[@${ data . user } ](https://github.com/${ data . user } )` ,
34
+ pull : `[#${ data . pull } ](https://github.com/${ data . repo } /pull/${ data . pull } )` ,
35
+ commit : `[\`${ data . commit . slice ( 0 , 7 ) } \`](https://github.com/${ data . repo } /commit/${ data . commit } )` ,
36
+ } ,
37
+ } ) ,
38
+ } , "getInfoFromPullRequest" ) ;
38
39
} ) ;
39
40
40
41
test . afterEach . always ( ( ) => {
@@ -77,7 +78,7 @@ const getChangeset = (content, commit) => {
77
78
commitFromChangeset
78
79
)
79
80
) ,
80
- "\n\n- [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003 ) Thanks [@Andarist](https://github.com/Andarist)! - something \n"
81
+ "\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85 ) Thanks [@Andarist](https://github.com/Andarist)!\n\nsomething \n"
81
82
) ;
82
83
} ) ;
83
84
@@ -89,7 +90,7 @@ const getChangeset = (content, commit) => {
89
90
commitFromChangeset
90
91
)
91
92
) ,
92
- "\n\n- [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003 ) Thanks [@Andarist](https://github.com/Andarist)! - something \n"
93
+ "\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85 ) Thanks [@Andarist](https://github.com/Andarist)!\n\nsomething \n"
93
94
) ;
94
95
} ) ;
95
96
} ) ;
@@ -99,7 +100,7 @@ const getChangeset = (content, commit) => {
99
100
await changelogFunctions . getReleaseLine (
100
101
...getChangeset ( `commit: ${ data . commit } ` , commitFromChangeset )
101
102
) ,
102
- "\n\n- [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003 ) Thanks [@Andarist](https://github.com/Andarist)! - something \n"
103
+ "\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85 ) Thanks [@Andarist](https://github.com/Andarist)!\n\nsomething \n"
103
104
) ;
104
105
} ) ;
105
106
} ) ;
@@ -113,7 +114,7 @@ const getChangeset = (content, commit) => {
113
114
data . commit
114
115
)
115
116
) ,
116
- "\n\n- [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003 ) Thanks [@other](https://github.com/other)!\n\nsomething\n"
117
+ "\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85 ) Thanks [@other](https://github.com/other)!\n\nsomething\n"
117
118
) ;
118
119
} ) ;
119
120
@@ -125,7 +126,7 @@ const getChangeset = (content, commit) => {
125
126
data . commit
126
127
)
127
128
) ,
128
- "\n\n- [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003 ) Thanks [@other](https://github.com/other)!\n\nsomething\n"
129
+ "\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [`a085003`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85 ) Thanks [@other](https://github.com/other)!\n\nsomething\n"
129
130
) ;
130
131
} ) ;
131
132
} ) ;
@@ -138,6 +139,6 @@ test("with multiple authors", async (t) => {
138
139
data . commit
139
140
)
140
141
) ,
141
- `
142
- - [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003) Thanks [@Andarist](https://github.com/Andarist), [@mitchellhamilton](https://github.com/mitchellhamilton)!\n\nsomething` ) ;
142
+ `\n\n📝 [#1613](https://github.com/emotion-js/emotion/pull/1613) [\`a085003\`](https://github.com/emotion-js/emotion/commit/a085003d4c8ca284c116668d7217fb747802ed85) Thanks [@Andarist](https://github.com/Andarist), [@mitchellhamilton](https://github.com/mitchellhamilton)!\n\nsomething\n `
143
+ ) ;
143
144
} ) ;
0 commit comments