@@ -14,7 +14,10 @@ test('when given a single dependency it sets its values', async () => {
1414 {
1515 dependencyName : 'coffee-rails' ,
1616 dependencyType : 'direct:production' ,
17- updateType : 'version-update:semver-minor'
17+ updateType : 'version-update:semver-minor' ,
18+ directory : 'wwwroot' ,
19+ packageEcosystem : 'nuget' ,
20+ targetBranch : 'main'
1821 }
1922 ]
2023
@@ -29,29 +32,44 @@ test('when given a single dependency it sets its values', async () => {
2932 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-names' , 'coffee-rails' )
3033 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-type' , 'direct:production' )
3134 expect ( core . setOutput ) . toBeCalledWith ( 'update-type' , 'version-update:semver-minor' )
35+ expect ( core . setOutput ) . toBeCalledWith ( 'directory' , 'wwwroot' )
36+ expect ( core . setOutput ) . toBeCalledWith ( 'package-ecosystem' , 'nuget' )
37+ expect ( core . setOutput ) . toBeCalledWith ( 'target_branch' , 'main' )
3238} )
3339
3440test ( 'when given a multiple dependencies, it uses the highest values for types' , async ( ) => {
3541 const updatedDependencies = [
3642 {
3743 dependencyName : 'rspec' ,
3844 dependencyType : 'direct:development' ,
39- updateType : 'version-update:semver-minor'
45+ updateType : 'version-update:semver-minor' ,
46+ directory : '' ,
47+ packageEcosystem : '' ,
48+ targetBranch : ''
4049 } ,
4150 {
4251 dependencyName : 'coffee-rails' ,
4352 dependencyType : 'indirect' ,
44- updateType : 'version-update:semver-minor'
53+ updateType : 'version-update:semver-minor' ,
54+ directory : '' ,
55+ packageEcosystem : '' ,
56+ targetBranch : ''
4557 } ,
4658 {
4759 dependencyName : 'coffeescript' ,
4860 dependencyType : 'indirect' ,
49- updateType : 'version-update:semver-major'
61+ updateType : 'version-update:semver-major' ,
62+ directory : '' ,
63+ packageEcosystem : '' ,
64+ targetBranch : ''
5065 } ,
5166 {
5267 dependencyName : 'rspec-coffeescript' ,
5368 dependencyType : 'indirect' ,
54- updateType : 'version-update:semver-patch'
69+ updateType : 'version-update:semver-patch' ,
70+ directory : '' ,
71+ packageEcosystem : '' ,
72+ targetBranch : ''
5573 }
5674 ]
5775
@@ -62,14 +80,20 @@ test('when given a multiple dependencies, it uses the highest values for types',
6280 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-names' , 'rspec, coffee-rails, coffeescript, rspec-coffeescript' )
6381 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-type' , 'direct:development' )
6482 expect ( core . setOutput ) . toBeCalledWith ( 'update-type' , 'version-update:semver-major' )
83+ expect ( core . setOutput ) . toBeCalledWith ( 'directory' , '' )
84+ expect ( core . setOutput ) . toBeCalledWith ( 'package-ecosystem' , '' )
85+ expect ( core . setOutput ) . toBeCalledWith ( 'target_branch' , '' )
6586} )
6687
6788test ( 'when the dependency has no update type' , async ( ) => {
6889 const updatedDependencies = [
6990 {
7091 dependencyName : 'coffee-rails' ,
7192 dependencyType : 'direct:production' ,
72- updateType : ''
93+ updateType : '' ,
94+ directory : '' ,
95+ packageEcosystem : '' ,
96+ targetBranch : ''
7397 }
7498 ]
7599
@@ -84,29 +108,44 @@ test('when the dependency has no update type', async () => {
84108 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-names' , 'coffee-rails' )
85109 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-type' , 'direct:production' )
86110 expect ( core . setOutput ) . toBeCalledWith ( 'update-type' , null )
111+ expect ( core . setOutput ) . toBeCalledWith ( 'directory' , '' )
112+ expect ( core . setOutput ) . toBeCalledWith ( 'package-ecosystem' , '' )
113+ expect ( core . setOutput ) . toBeCalledWith ( 'target_branch' , '' )
87114} )
88115
89116test ( 'when given a multiple dependencies, and some do not have update types' , async ( ) => {
90117 const updatedDependencies = [
91118 {
92119 dependencyName : 'rspec' ,
93120 dependencyType : 'direct:development' ,
94- updateType : ''
121+ updateType : '' ,
122+ directory : '' ,
123+ packageEcosystem : '' ,
124+ targetBranch : ''
95125 } ,
96126 {
97127 dependencyName : 'coffee-rails' ,
98128 dependencyType : 'indirect' ,
99- updateType : 'version-update:semver-minor'
129+ updateType : 'version-update:semver-minor' ,
130+ directory : '' ,
131+ packageEcosystem : '' ,
132+ targetBranch : ''
100133 } ,
101134 {
102135 dependencyName : 'coffeescript' ,
103136 dependencyType : 'indirect' ,
104- updateType : ''
137+ updateType : '' ,
138+ directory : '' ,
139+ packageEcosystem : '' ,
140+ targetBranch : ''
105141 } ,
106142 {
107143 dependencyName : 'rspec-coffeescript' ,
108144 dependencyType : 'indirect' ,
109- updateType : 'version-update:semver-patch'
145+ updateType : 'version-update:semver-patch' ,
146+ directory : '' ,
147+ packageEcosystem : '' ,
148+ targetBranch : ''
110149 }
111150 ]
112151
@@ -117,4 +156,7 @@ test('when given a multiple dependencies, and some do not have update types', as
117156 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-names' , 'rspec, coffee-rails, coffeescript, rspec-coffeescript' )
118157 expect ( core . setOutput ) . toBeCalledWith ( 'dependency-type' , 'direct:development' )
119158 expect ( core . setOutput ) . toBeCalledWith ( 'update-type' , 'version-update:semver-minor' )
159+ expect ( core . setOutput ) . toBeCalledWith ( 'directory' , '' )
160+ expect ( core . setOutput ) . toBeCalledWith ( 'package-ecosystem' , '' )
161+ expect ( core . setOutput ) . toBeCalledWith ( 'target_branch' , '' )
120162} )
0 commit comments